878#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
879#define _CRT_SECURE_NO_WARNINGS
882#ifndef IMGUI_DEFINE_MATH_OPERATORS
883#define IMGUI_DEFINE_MATH_OPERATORS
892#if defined(_MSC_VER) && _MSC_VER <= 1500
899#if defined(_WIN32) && !defined(_MSC_VER) && !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
900#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
904#if defined(_WIN32) && defined(IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS) && defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
905#define IMGUI_DISABLE_WIN32_FUNCTIONS
907#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
908#ifndef WIN32_LEAN_AND_MEAN
909#define WIN32_LEAN_AND_MEAN
919#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
920#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
921#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
926#if defined(__APPLE__)
927#include <TargetConditionals.h>
932#pragma warning (disable: 4127)
933#pragma warning (disable: 4996)
934#if defined(_MSC_VER) && _MSC_VER >= 1922
935#pragma warning (disable: 5054)
937#pragma warning (disable: 26451)
938#pragma warning (disable: 26495)
939#pragma warning (disable: 26812)
943#if defined(__clang__)
944#if __has_warning("-Wunknown-warning-option")
945#pragma clang diagnostic ignored "-Wunknown-warning-option"
947#pragma clang diagnostic ignored "-Wunknown-pragmas"
948#pragma clang diagnostic ignored "-Wold-style-cast"
949#pragma clang diagnostic ignored "-Wfloat-equal"
950#pragma clang diagnostic ignored "-Wformat-nonliteral"
951#pragma clang diagnostic ignored "-Wexit-time-destructors"
952#pragma clang diagnostic ignored "-Wglobal-constructors"
953#pragma clang diagnostic ignored "-Wsign-conversion"
954#pragma clang diagnostic ignored "-Wformat-pedantic"
955#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast"
956#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
957#pragma clang diagnostic ignored "-Wdouble-promotion"
958#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
959#elif defined(__GNUC__)
961#pragma GCC diagnostic ignored "-Wpragmas"
962#pragma GCC diagnostic ignored "-Wunused-function"
963#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
964#pragma GCC diagnostic ignored "-Wformat"
965#pragma GCC diagnostic ignored "-Wdouble-promotion"
966#pragma GCC diagnostic ignored "-Wconversion"
967#pragma GCC diagnostic ignored "-Wformat-nonliteral"
968#pragma GCC diagnostic ignored "-Wstrict-overflow"
969#pragma GCC diagnostic ignored "-Wclass-memaccess"
973#define IMGUI_DEBUG_NAV_SCORING 0
974#define IMGUI_DEBUG_NAV_RECTS 0
975#define IMGUI_DEBUG_INI_SETTINGS 0
978static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f;
979static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f;
982static const float WINDOWS_HOVER_PADDING = 4.0f;
983static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f;
984static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 0.70f;
991static void FindHoveredWindow();
1006static const char* GetClipboardTextFn_DefaultImpl(
void* user_data_ctx);
1007static void SetClipboardTextFn_DefaultImpl(
void* user_data_ctx,
const char* text);
1013static void NavUpdate();
1014static void NavUpdateWindowing();
1015static void NavUpdateWindowingOverlay();
1016static void NavUpdateCancelRequest();
1017static void NavUpdateCreateMoveRequest();
1018static void NavUpdateCreateTabbingRequest();
1019static float NavUpdatePageUpPageDown();
1020static inline void NavUpdateAnyRequestFlag();
1021static void NavUpdateCreateWrappingRequest();
1022static void NavEndFrame();
1025static void NavProcessItem();
1027static ImVec2 NavCalcPreferredRefPos();
1028static void NavSaveLastChildNavWindowIntoParent(
ImGuiWindow* nav_window);
1031static void NavRestoreHighlightAfterMove();
1032static int FindWindowFocusIndex(
ImGuiWindow* window);
1035static void ErrorCheckNewFrameSanityChecks();
1036static void ErrorCheckEndFrameSanityChecks();
1037static void UpdateDebugToolItemPicker();
1038static void UpdateDebugToolStackQueries();
1041static void UpdateKeyboardInputs();
1042static void UpdateMouseInputs();
1043static void UpdateMouseWheel();
1047static void UpdateSettings();
1048static bool UpdateWindowManualResize(
ImGuiWindow* window,
const ImVec2& size_auto_fit,
int* border_held,
int resize_grip_count,
ImU32 resize_grip_col[4],
const ImRect& visibility_rect);
1049static void RenderWindowOuterBorders(
ImGuiWindow* window);
1050static void RenderWindowDecorations(
ImGuiWindow* window,
const ImRect& title_bar_rect,
bool title_bar_is_highlight,
bool handle_borders_and_resize_grips,
int resize_grip_count,
const ImU32 resize_grip_col[4],
float resize_grip_draw_size);
1051static void RenderWindowTitleBarContents(
ImGuiWindow* window,
const ImRect& title_bar_rect,
const char* name,
bool* p_open);
1052static void RenderDimmedBackgroundBehindWindow(
ImGuiWindow* window,
ImU32 col);
1053static void RenderDimmedBackgrounds();
1057static void UpdateViewportsNewFrame();
1092#ifndef IMGUI_DISABLE_DEFAULT_ALLOCATORS
1093static void* MallocWrapper(
size_t size,
void* user_data) {
IM_UNUSED(user_data);
return malloc(size); }
1094static void FreeWrapper(
void* ptr,
void* user_data) {
IM_UNUSED(user_data); free(ptr); }
1101static void* GImAllocatorUserData = NULL;
1190 memset(
this, 0,
sizeof(*
this));
1203#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1275 if ((c & 0xFC00) == 0xD800)
1286 if ((c & 0xFC00) != 0xDC00)
1292#if IM_UNICODE_CODEPOINT_MAX == 0xFFFF
1308 while (*utf8_chars != 0)
1325#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1351 if (e->
Type != type)
1378#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1382 IM_ASSERT(
KeyMap[n] == -1 &&
"Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
1391 const bool latest_key_down = latest_event ? latest_event->
Key.
Down : key_data->
Down;
1393 if (latest_key_down == down && latest_key_analog == analog_value)
1426#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1427 const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode;
1430 KeyMap[legacy_key] = key;
1431 KeyMap[key] = legacy_key;
1453 ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y);
1457 const ImVec2 latest_pos = latest_event ?
ImVec2(latest_event->MousePos.PosX, latest_event->MousePos.PosY) : g.
IO.
MousePos;
1458 if (latest_pos.
x == pos.
x && latest_pos.
y == pos.
y)
1480 if (latest_button_down == down)
1517 if (latest_focused == focused)
1535 float p_closest_dist2 = FLT_MAX;
1536 float t_step = 1.0f / (float)num_segments;
1537 for (
int i_step = 1; i_step <= num_segments; i_step++)
1541 float dist2 = ImLengthSqr(p - p_line);
1542 if (dist2 < p_closest_dist2)
1545 p_closest_dist2 = dist2;
1553static void ImBezierCubicClosestPointCasteljauStep(
const ImVec2& p,
ImVec2& p_closest,
ImVec2& p_last,
float& p_closest_dist2,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4,
float tess_tol,
int level)
1557 float d2 = ((x2 - x4) * dy - (y2 - y4) * dx);
1558 float d3 = ((x3 - x4) * dy - (y3 - y4) * dx);
1559 d2 = (d2 >= 0) ? d2 : -d2;
1560 d3 = (d3 >= 0) ? d3 : -d3;
1561 if ((d2 + d3) * (d2 + d3) < tess_tol * (dx * dx + dy * dy))
1563 ImVec2 p_current(x4, y4);
1565 float dist2 = ImLengthSqr(p - p_line);
1566 if (dist2 < p_closest_dist2)
1569 p_closest_dist2 = dist2;
1573 else if (level < 10)
1575 float x12 = (x1 + x2)*0.5f, y12 = (y1 + y2)*0.5f;
1576 float x23 = (x2 + x3)*0.5f, y23 = (y2 + y3)*0.5f;
1577 float x34 = (x3 + x4)*0.5f, y34 = (y3 + y4)*0.5f;
1578 float x123 = (x12 + x23)*0.5f, y123 = (y12 + y23)*0.5f;
1579 float x234 = (x23 + x34)*0.5f, y234 = (y23 + y34)*0.5f;
1580 float x1234 = (x123 + x234)*0.5f, y1234 = (y123 + y234)*0.5f;
1581 ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
1582 ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
1593 float p_closest_dist2 = FLT_MAX;
1594 ImBezierCubicClosestPointCasteljauStep(p, p_closest, p_last, p_closest_dist2, p1.
x, p1.
y, p2.
x, p2.
y, p3.
x, p3.
y, p4.
x, p4.
y, tess_tol, 0);
1602 float dot = ap.
x * ab_dir.
x + ap.
y * ab_dir.
y;
1605 float ab_len_sqr = ab_dir.
x * ab_dir.
x + ab_dir.
y * ab_dir.
y;
1606 if (dot > ab_len_sqr)
1608 return a + ab_dir * dot / ab_len_sqr;
1613 bool b1 = ((p.
x - b.
x) * (a.
y - b.
y) - (p.
y - b.
y) * (a.
x - b.
x)) < 0.0f;
1614 bool b2 = ((p.
x - c.
x) * (b.
y - c.
y) - (p.
y - c.
y) * (b.
x - c.
x)) < 0.0f;
1615 bool b3 = ((p.
x - a.
x) * (c.
y - a.
y) - (p.
y - a.
y) * (c.
x - a.
x)) < 0.0f;
1616 return ((b1 == b2) && (b2 == b3));
1624 const float denom = v0.
x * v1.
y - v1.
x * v0.
y;
1625 out_v = (v2.
x * v1.
y - v1.
x * v2.
y) / denom;
1626 out_w = (v0.
x * v2.
y - v2.
x * v0.
y) / denom;
1627 out_u = 1.0f - out_v - out_w;
1635 float dist2_ab = ImLengthSqr(p - proj_ab);
1636 float dist2_bc = ImLengthSqr(p - proj_bc);
1637 float dist2_ca = ImLengthSqr(p - proj_ca);
1638 float m = ImMin(dist2_ab, ImMin(dist2_bc, dist2_ca));
1654 while ((d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; }
1661 while (count > 0 && (d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
1670 strncpy(dst, src, count - 1);
1676 size_t len = strlen(str);
1678 return (
char*)memcpy(buf, (
const void*)str, len + 1);
1683 size_t dst_buf_size = p_dst_size ? *p_dst_size : strlen(dst) + 1;
1684 size_t src_size = strlen(src) + 1;
1685 if (dst_buf_size < src_size)
1690 *p_dst_size = src_size;
1692 return (
char*)memcpy(dst, (
const void*)src, src_size);
1697 const char* p = (
const char*)memchr(str, (
int)c, str_end - str);
1712 const char* p = (
const char*)memchr(str,
'\n', str_end - str);
1713 return p ? p : str_end;
1718 while (buf_mid_line > buf_begin && buf_mid_line[-1] !=
'\n')
1720 return buf_mid_line;
1723const char*
ImStristr(
const char* haystack,
const char* haystack_end,
const char* needle,
const char* needle_end)
1726 needle_end = needle + strlen(needle);
1728 const char un0 = (char)ImToUpper(*needle);
1729 while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
1731 if (ImToUpper(*haystack) == un0)
1733 const char* b = needle + 1;
1734 for (
const char* a = haystack + 1; b < needle_end; a++, b++)
1735 if (ImToUpper(*a) != ImToUpper(*b))
1737 if (b == needle_end)
1749 while (p[0] ==
' ' || p[0] ==
'\t')
1754 while (p > p_start && (p[-1] ==
' ' || p[-1] ==
'\t'))
1757 memmove(buf, p_start, p - p_start);
1758 buf[p - p_start] = 0;
1763 while (str[0] ==
' ' || str[0] ==
'\t')
1771#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
1777#ifdef IMGUI_USE_STB_SPRINTF
1778#define STB_SPRINTF_IMPLEMENTATION
1779#ifdef IMGUI_STB_SPRINTF_FILENAME
1780#include IMGUI_STB_SPRINTF_FILENAME
1782#include "stb_sprintf.h"
1786#if defined(_MSC_VER) && !defined(vsnprintf)
1787#define vsnprintf _vsnprintf
1793 va_start(args, fmt);
1794#ifdef IMGUI_USE_STB_SPRINTF
1795 int w = stbsp_vsnprintf(buf, (
int)buf_size, fmt, args);
1797 int w = vsnprintf(buf, buf_size, fmt, args);
1802 if (w == -1 || w >= (
int)buf_size)
1803 w = (int)buf_size - 1;
1810#ifdef IMGUI_USE_STB_SPRINTF
1811 int w = stbsp_vsnprintf(buf, (
int)buf_size, fmt, args);
1813 int w = vsnprintf(buf, buf_size, fmt, args);
1817 if (w == -1 || w >= (
int)buf_size)
1818 w = (int)buf_size - 1;
1828 va_start(args, fmt);
1829 if (fmt[0] ==
'%' && fmt[1] ==
's' && fmt[2] == 0)
1831 const char* buf = va_arg(args,
const char*);
1833 if (out_buf_end) { *out_buf_end = buf + strlen(buf); }
1847 if (fmt[0] ==
'%' && fmt[1] ==
's' && fmt[2] == 0)
1849 const char* buf = va_arg(args,
const char*);
1851 if (out_buf_end) { *out_buf_end = buf + strlen(buf); }
1864static const ImU32 GCrc32LookupTable[256] =
1866 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,
1867 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,
1868 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,
1869 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D,
1870 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01,
1871 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,
1872 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9,
1873 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD,
1874 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,
1875 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,
1876 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79,
1877 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F,0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,
1878 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,
1879 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,
1880 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9,
1881 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D,
1890 const unsigned char* data = (
const unsigned char*)data_p;
1891 const ImU32* crc32_lut = GCrc32LookupTable;
1892 while (data_size-- != 0)
1893 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ *data++];
1907 const unsigned char* data = (
const unsigned char*)data_p;
1908 const ImU32* crc32_lut = GCrc32LookupTable;
1911 while (data_size-- != 0)
1913 unsigned char c = *data++;
1914 if (c ==
'#' && data_size >= 2 && data[0] ==
'#' && data[1] ==
'#')
1916 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
1921 while (
unsigned char c = *data++)
1923 if (c ==
'#' && data[0] ==
'#' && data[1] ==
'#')
1925 crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
1936#ifndef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
1940#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
1943 const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
1944 const int mode_wsize = ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0);
1946 buf.
resize(filename_wsize + mode_wsize);
1947 ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, (
wchar_t*)&buf[0], filename_wsize);
1948 ::MultiByteToWideChar(CP_UTF8, 0, mode, -1, (
wchar_t*)&buf[filename_wsize], mode_wsize);
1949 return ::_wfopen((
const wchar_t*)&buf[0], (
const wchar_t*)&buf[filename_wsize]);
1951 return fopen(filename, mode);
1965void*
ImFileLoadToMemory(
const char* filename,
const char* mode,
size_t* out_file_size,
int padding_bytes)
1972 if ((f =
ImFileOpen(filename, mode)) == NULL)
1976 if (file_size == (
size_t)-1)
1982 void* file_data =
IM_ALLOC(file_size + padding_bytes);
1983 if (file_data == NULL)
1988 if (
ImFileRead(file_data, 1, file_size, f) != file_size)
1994 if (padding_bytes > 0)
1995 memset((
void*)(((
char*)file_data) + file_size), 0, (
size_t)padding_bytes);
1999 *out_file_size = file_size;
2015 static const char lengths[32] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 3, 4, 0 };
2016 static const int masks[] = { 0x00, 0x7f, 0x1f, 0x0f, 0x07 };
2017 static const uint32_t mins[] = { 0x400000, 0, 0x80, 0x800, 0x10000 };
2018 static const int shiftc[] = { 0, 18, 12, 6, 0 };
2019 static const int shifte[] = { 0, 6, 4, 2, 0 };
2020 int len = lengths[*(
const unsigned char*)in_text >> 3];
2021 int wanted = len + (len ? 0 : 1);
2023 if (in_text_end == NULL)
2024 in_text_end = in_text + wanted;
2029 s[0] = in_text + 0 < in_text_end ? in_text[0] : 0;
2030 s[1] = in_text + 1 < in_text_end ? in_text[1] : 0;
2031 s[2] = in_text + 2 < in_text_end ? in_text[2] : 0;
2032 s[3] = in_text + 3 < in_text_end ? in_text[3] : 0;
2035 *out_char = (uint32_t)(s[0] & masks[len]) << 18;
2036 *out_char |= (uint32_t)(s[1] & 0x3f) << 12;
2037 *out_char |= (uint32_t)(s[2] & 0x3f) << 6;
2038 *out_char |= (uint32_t)(s[3] & 0x3f) << 0;
2039 *out_char >>= shiftc[len];
2043 e = (*out_char < mins[len]) << 6;
2044 e |= ((*out_char >> 11) == 0x1b) << 7;
2046 e |= (s[1] & 0xc0) >> 2;
2047 e |= (s[2] & 0xc0) >> 4;
2058 wanted = ImMin(wanted, !!s[0] + !!s[1] + !!s[2] + !!s[3]);
2068 ImWchar* buf_end = buf + buf_size;
2069 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2076 if (in_text_remaining)
2077 *in_text_remaining = in_text;
2078 return (
int)(buf_out - buf);
2084 while ((!in_text_end || in_text < in_text_end) && *in_text)
2094static inline int ImTextCharToUtf8_inline(
char* buf,
int buf_size,
unsigned int c)
2103 if (buf_size < 2)
return 0;
2104 buf[0] = (char)(0xc0 + (c >> 6));
2105 buf[1] = (char)(0x80 + (c & 0x3f));
2110 if (buf_size < 3)
return 0;
2111 buf[0] = (char)(0xe0 + (c >> 12));
2112 buf[1] = (char)(0x80 + ((c >> 6) & 0x3f));
2113 buf[2] = (char)(0x80 + ((c ) & 0x3f));
2118 if (buf_size < 4)
return 0;
2119 buf[0] = (char)(0xf0 + (c >> 18));
2120 buf[1] = (char)(0x80 + ((c >> 12) & 0x3f));
2121 buf[2] = (char)(0x80 + ((c >> 6) & 0x3f));
2122 buf[3] = (char)(0x80 + ((c ) & 0x3f));
2131 int count = ImTextCharToUtf8_inline(out_buf, 5, c);
2139 unsigned int unused = 0;
2145 if (c < 0x80)
return 1;
2146 if (c < 0x800)
return 2;
2147 if (c < 0x10000)
return 3;
2148 if (c <= 0x10FFFF)
return 4;
2154 char* buf_p = out_buf;
2155 const char* buf_end = out_buf + out_buf_size;
2156 while (buf_p < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2158 unsigned int c = (
unsigned int)(*in_text++);
2162 buf_p += ImTextCharToUtf8_inline(buf_p, (
int)(buf_end - buf_p - 1), c);
2165 return (
int)(buf_p - out_buf);
2170 int bytes_count = 0;
2171 while ((!in_text_end || in_text < in_text_end) && *in_text)
2173 unsigned int c = (
unsigned int)(*in_text++);
2199 float s = 1.0f / 255.0f;
2233 const float chroma = r - (g < b ? g : b);
2234 out_h =
ImFabs(K + (g - b) / (6.f * chroma + 1e-20f));
2235 out_s = chroma / (r + 1e-20f);
2246 out_r = out_g = out_b = v;
2250 h =
ImFmod(h, 1.0f) / (60.0f / 360.0f);
2252 float f = h - (float)i;
2253 float p = v * (1.0f - s);
2254 float q = v * (1.0f - s * f);
2255 float t = v * (1.0f - s * (1.0f - f));
2259 case 0: out_r = v; out_g = t; out_b = p;
break;
2260 case 1: out_r = q; out_g = v; out_b = p;
break;
2261 case 2: out_r = p; out_g = v; out_b = t;
break;
2262 case 3: out_r = p; out_g = q; out_b = v;
break;
2263 case 4: out_r = t; out_g = p; out_b = v;
break;
2264 case 5:
default: out_r = v; out_g = p; out_b = q;
break;
2278 size_t count = (size_t)(last - first);
2281 size_t count2 = count >> 1;
2286 count -= count2 + 1;
2301 static int IMGUI_CDECL PairComparerByID(
const void* lhs,
const void* rhs)
2315 if (it ==
Data.end() || it->
key != key)
2322 return GetInt(key, default_val ? 1 : 0) != 0;
2328 if (it ==
Data.end() || it->
key != key)
2336 if (it ==
Data.end() || it->
key != key)
2345 if (it ==
Data.end() || it->
key != key)
2352 return (
bool*)
GetIntRef(key, default_val ? 1 : 0);
2358 if (it ==
Data.end() || it->
key != key)
2366 if (it ==
Data.end() || it->
key != key)
2375 if (it ==
Data.end() || it->
key != key)
2385 SetInt(key, val ? 1 : 0);
2391 if (it ==
Data.end() || it->
key != key)
2402 if (it ==
Data.end() || it->
key != key)
2412 for (
int i = 0; i <
Data.Size; i++)
2439 return value_changed;
2446 const char* we = wb;
2449 if (*we == separator)
2467 for (
int i = 0; i !=
Filters.Size; i++)
2470 while (f.
b < f.
e && ImCharIsBlankA(f.
b[0]))
2472 while (f.
e > f.
b && ImCharIsBlankA(f.
e[-1]))
2489 for (
int i = 0; i !=
Filters.Size; i++)
2497 if (
ImStristr(text, text_end, f.
b + 1, f.
e) != NULL)
2522#if defined(__GNUC__) || defined(__clang__)
2523#define va_copy(dest, src) __builtin_va_copy(dest, src)
2525#define va_copy(dest, src) (dest = src)
2533 int len = str_end ? (int)(str_end - str) : (int)strlen(str);
2536 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2537 const int needed_sz = write_off + len;
2538 if (write_off + len >= Buf.Capacity)
2540 int new_capacity = Buf.Capacity * 2;
2541 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2544 Buf.resize(needed_sz);
2545 memcpy(&Buf[write_off - 1], str, (
size_t)len);
2546 Buf[write_off - 1 + len] = 0;
2552 va_start(args, fmt);
2553 appendfv(fmt, args);
2571 const int write_off = (Buf.Size != 0) ? Buf.Size : 1;
2572 const int needed_sz = write_off + len;
2573 if (write_off + len >= Buf.Capacity)
2575 int new_capacity = Buf.Capacity * 2;
2576 Buf.reserve(needed_sz > new_capacity ? needed_sz : new_capacity);
2579 Buf.resize(needed_sz);
2580 ImFormatStringV(&Buf[write_off - 1], (
size_t)len + 1, fmt, args_copy);
2586 IM_ASSERT(old_size >= 0 && new_size >= old_size && new_size >= EndOffset);
2587 if (old_size == new_size)
2589 if (EndOffset == 0 || base[EndOffset - 1] ==
'\n')
2590 LineOffsets.push_back(EndOffset);
2591 const char* base_end = base + new_size;
2592 for (
const char* p = base + old_size; (p = (
const char*)memchr(p,
'\n', base_end - p)) != 0; )
2594 LineOffsets.push_back((
int)(intptr_t)(p - base));
2595 EndOffset = ImMax(EndOffset, new_size);
2606static bool GetSkipItemForListClipping()
2612#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2623 *out_items_display_start = 0;
2624 *out_items_display_end = items_count;
2627 if (GetSkipItemForListClipping())
2629 *out_items_display_start = *out_items_display_end = 0;
2642 int start = (int)((rect.
Min.
y - pos.
y) / items_height);
2643 int end = (int)((rect.
Max.
y - pos.
y) / items_height);
2653 start = ImClamp(start, 0, items_count);
2654 end = ImClamp(end + 1, start, items_count);
2655 *out_items_display_start = start;
2656 *out_items_display_end = end;
2662 if (ranges.
Size - offset <= 1)
2666 for (
int sort_end = ranges.
Size - offset - 1; sort_end > 0; --sort_end)
2667 for (
int i = offset; i < sort_end + offset; ++i)
2668 if (ranges[i].Min > ranges[i + 1].Min)
2669 ImSwap(ranges[i], ranges[i + 1]);
2672 for (
int i = 1 + offset; i < ranges.
Size; i++)
2674 IM_ASSERT(!ranges[i].PosToIndexConvert && !ranges[i - 1].PosToIndexConvert);
2675 if (ranges[i - 1].Max < ranges[i].Min)
2677 ranges[i - 1].Min = ImMin(ranges[i - 1].Min, ranges[i].Min);
2678 ranges[i - 1].Max = ImMax(ranges[i - 1].Max, ranges[i].Max);
2684static void ImGuiListClipper_SeekCursorAndSetupPrevLine(
float pos_y,
float line_height)
2700 if (table->IsInsideRow)
2703 const int row_increase = (int)((off_y / line_height) + 0.5f);
2705 table->RowBgColorCounter += row_increase;
2709static void ImGuiListClipper_SeekCursorForItem(
ImGuiListClipper* clipper,
int item_n)
2714 float pos_y = (float)((
double)clipper->StartPosY + data->LossynessOffset + (double)(item_n - data->ItemsFrozen) * clipper->ItemsHeight);
2715 ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, clipper->ItemsHeight);
2720 memset(
this, 0,
sizeof(*
this));
2738 if (table->IsInsideRow)
2742 ItemsHeight = items_height;
2743 ItemsCount = items_count;
2763 if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0)
2764 ImGuiListClipper_SeekCursorForItem(
this, ItemsCount);
2768 data->StepNo = data->Ranges.
Size;
2772 data->ListClipper->TempData = data;
2784 if (item_min < item_max)
2793 IM_ASSERT(data != NULL &&
"Called ImGuiListClipper::Step() too many times, or before ImGuiListClipper::Begin() ?");
2800 if (clipper->ItemsCount == 0 || GetSkipItemForListClipping())
2805 if (data->StepNo == 0 && table != NULL && !table->
IsUnfrozenRows)
2807 clipper->DisplayStart = data->ItemsFrozen;
2808 clipper->DisplayEnd = ImMin(data->ItemsFrozen + 1, clipper->ItemsCount);
2809 if (clipper->DisplayStart < clipper->DisplayEnd)
2810 data->ItemsFrozen++;
2815 bool calc_clipping =
false;
2816 if (data->StepNo == 0)
2819 if (clipper->ItemsHeight <= 0.0f)
2823 clipper->DisplayStart = ImMax(data->Ranges[0].Min, data->ItemsFrozen);
2824 clipper->DisplayEnd = ImMin(data->Ranges[0].Max, clipper->ItemsCount);
2828 calc_clipping =
true;
2832 if (clipper->ItemsHeight <= 0.0f)
2838 clipper->ItemsHeight = (window->
DC.
CursorPos.
y - clipper->StartPosY) / (
float)(clipper->DisplayEnd - clipper->DisplayStart);
2839 bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->
DC.
CursorPos.
y);
2840 if (affected_by_floating_point_precision)
2843 IM_ASSERT(clipper->ItemsHeight > 0.0f &&
"Unable to calculate item height! First item hasn't moved the cursor vertically!");
2844 calc_clipping =
true;
2848 const int already_submitted = clipper->DisplayEnd;
2880 for (
int i = 0; i < data->Ranges.
Size; i++)
2881 if (data->Ranges[i].PosToIndexConvert)
2883 int m1 = (int)(((
double)data->Ranges[i].Min - window->
DC.
CursorPos.
y - data->LossynessOffset) / clipper->ItemsHeight);
2884 int m2 = (int)((((
double)data->Ranges[i].Max - window->
DC.
CursorPos.
y - data->LossynessOffset) / clipper->ItemsHeight) + 0.999999f);
2885 data->Ranges[i].Min = ImClamp(already_submitted + m1 + data->Ranges[i].PosToIndexOffsetMin, already_submitted, clipper->ItemsCount - 1);
2886 data->Ranges[i].Max = ImClamp(already_submitted + m2 + data->Ranges[i].PosToIndexOffsetMax, data->Ranges[i].Min + 1, clipper->ItemsCount);
2887 data->Ranges[i].PosToIndexConvert =
false;
2889 ImGuiListClipper_SortAndFuseRanges(data->Ranges, data->StepNo);
2893 if (data->StepNo < data->Ranges.
Size)
2895 clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted);
2896 clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount);
2897 if (clipper->DisplayStart > already_submitted)
2898 ImGuiListClipper_SeekCursorForItem(clipper, clipper->DisplayStart);
2905 if (clipper->ItemsCount < INT_MAX)
2906 ImGuiListClipper_SeekCursorForItem(clipper, clipper->ItemsCount);
2914 bool need_items_height = (ItemsHeight <= 0.0f);
2915 bool ret = ImGuiListClipper_StepInternal(
this);
2916 if (ret && (DisplayStart == DisplayEnd))
2920 if (need_items_height && ItemsHeight > 0.0f)
2940 IM_ASSERT(
GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
2948 c.
w *= style.
Alpha * alpha_mul;
2963 return style.
Colors[idx];
2969 if (style.
Alpha >= 1.0f)
3050 return &GStyleVarInfo[idx];
3175 const char* text_display_end = text;
3177 text_end = (
const char*)-1;
3179 while (text_display_end < text_end && *text_display_end !=
'\0' && (text_display_end[0] !=
'#' || text_display_end[1] !=
'#'))
3181 return text_display_end;
3192 const char* text_display_end;
3193 if (hide_text_after_hash)
3200 text_end = text + strlen(text);
3201 text_display_end = text_end;
3204 if (text != text_display_end)
3218 text_end = text + strlen(text);
3220 if (text != text_end)
3234 const ImVec2 text_size = text_size_if_known ? *text_size_if_known :
CalcTextSize(text, text_display_end,
false, 0.0f);
3236 const ImVec2* clip_min = clip_rect ? &clip_rect->
Min : &pos_min;
3237 const ImVec2* clip_max = clip_rect ? &clip_rect->
Max : &pos_max;
3238 bool need_clipping = (pos.
x + text_size.
x >= clip_max->
x) || (pos.
y + text_size.
y >= clip_max->
y);
3240 need_clipping |= (pos.
x < clip_min->
x) || (pos.
y < clip_min->
y);
3243 if (align.
x > 0.0f) pos.
x = ImMax(pos.
x, pos.
x + (pos_max.
x - pos.
x - text_size.
x) * align.
x);
3244 if (align.
y > 0.0f) pos.
y = ImMax(pos.
y, pos.
y + (pos_max.
y - pos.
y - text_size.
y) * align.
y);
3249 ImVec4 fine_clip_rect(clip_min->
x, clip_min->
y, clip_max->
x, clip_max->
y);
3262 const int text_len = (int)(text_display_end - text);
3279 if (text_end_full == NULL)
3281 const ImVec2 text_size = text_size_if_known ? *text_size_if_known :
CalcTextSize(text, text_end_full,
false, 0.0f);
3287 if (text_size.
x > pos_max.
x - pos_min.
x)
3296 const float font_scale = font_size / font->
FontSize;
3297 const char* text_end_ellipsis = NULL;
3298 const float ellipsis_width = font->
EllipsisWidth * font_scale;
3301 const float text_avail_width = ImMax((ImMax(pos_max.
x, ellipsis_max_x) - ellipsis_width) - pos_min.
x, 1.0f);
3302 float text_size_clipped_x = font->
CalcTextSizeA(font_size, text_avail_width, 0.0f, text, text_end_full, &text_end_ellipsis).
x;
3303 if (text == text_end_ellipsis && text_end_ellipsis < text_end_full)
3307 text_size_clipped_x = font->
CalcTextSizeA(font_size, FLT_MAX, 0.0f, text, text_end_ellipsis).
x;
3309 while (text_end_ellipsis > text && ImCharIsBlankA(text_end_ellipsis[-1]))
3312 text_end_ellipsis--;
3313 text_size_clipped_x -= font->
CalcTextSizeA(font_size, FLT_MAX, 0.0f, text_end_ellipsis, text_end_ellipsis + 1).
x;
3318 ImVec2 ellipsis_pos = ImFloor(
ImVec2(pos_min.
x + text_size_clipped_x, pos_min.
y));
3319 if (ellipsis_pos.
x + ellipsis_width <= ellipsis_max_x)
3339 if (border && border_size > 0.0f)
3351 if (border_size > 0.0f)
3370 ImRect display_rect = bb;
3374 const float THICKNESS = 2.0f;
3375 const float DISTANCE = 3.0f + THICKNESS * 0.5f;
3398 ImVec2 offset, size, uv[4];
3402 const ImVec2 pos = base_pos - offset;
3403 const float scale = base_scale;
3409 draw_list->
AddImage(tex_id, pos +
ImVec2(1, 0) * scale, pos + (
ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow);
3410 draw_list->
AddImage(tex_id, pos +
ImVec2(2, 0) * scale, pos + (
ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow);
3411 draw_list->
AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border);
3412 draw_list->
AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill);
3430#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC
3431 IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx);
3439 GImAllocatorAllocFunc = alloc_func;
3440 GImAllocatorFreeFunc = free_func;
3441 GImAllocatorUserData = user_data;
3447 *p_alloc_func = GImAllocatorAllocFunc;
3448 *p_free_func = GImAllocatorFreeFunc;
3449 *p_user_data = GImAllocatorUserData;
3458 if (prev_ctx != NULL)
3496 ini_handler.
ClearAllFn = WindowSettingsHandler_ClearAll;
3497 ini_handler.
ReadOpenFn = WindowSettingsHandler_ReadOpen;
3498 ini_handler.
ReadLineFn = WindowSettingsHandler_ReadLine;
3499 ini_handler.
ApplyAllFn = WindowSettingsHandler_ApplyAll;
3500 ini_handler.
WriteAllFn = WindowSettingsHandler_WriteAll;
3519#ifdef IMGUI_HAS_DOCK
3589#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
3618 if (g.
Hooks[n].HookId == hook_id)
3628 if (g.
Hooks[n].Type == hook_type)
3640 memset(
this, 0,
sizeof(*
this));
3674 if (g.DebugHookIdInfo ==
id)
3794#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
3850 if (focused_root_window->WasActive && focused_root_window != window->
RootWindow)
3854 bool want_inhibit =
false;
3856 want_inhibit =
true;
3858 want_inhibit =
true;
4022 if (wrap_pos_x < 0.0f)
4027 if (wrap_pos_x == 0.0f)
4036 else if (wrap_pos_x > 0.0f)
4041 return ImMax(wrap_pos_x - pos.
x, 1.0f);
4048 ctx->IO.MetricsActiveAllocations++;
4049 return (*GImAllocatorAllocFunc)(size, GImAllocatorUserData);
4057 ctx->IO.MetricsActiveAllocations--;
4058 return (*GImAllocatorFreeFunc)(ptr, GImAllocatorUserData);
4081 IM_ASSERT(
GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
4109 if (draw_list == NULL)
4113 viewport->
DrawLists[drawlist_no] = draw_list;
4129 return GetViewportDrawList((
ImGuiViewportP*)viewport, 0,
"##Background");
4140 return GetViewportDrawList((
ImGuiViewportP*)viewport, 1,
"##Foreground");
4167 bool can_move_window =
true;
4169 can_move_window =
false;
4170 if (can_move_window)
4234 if (root_window != NULL && !is_closed_popup)
4267static bool IsWindowActiveAndVisible(
ImGuiWindow* window)
4283 bool clear_hovered_windows =
false;
4284 FindHoveredWindow();
4289 clear_hovered_windows =
true;
4293 clear_hovered_windows =
true;
4298 const bool has_open_modal = (modal_window != NULL);
4299 int mouse_earliest_down = -1;
4300 bool mouse_any_down =
false;
4311 mouse_earliest_down = i;
4313 const bool mouse_avail = (mouse_earliest_down == -1) || io.
MouseDownOwned[mouse_earliest_down];
4319 if (!mouse_avail && !mouse_dragging_extern_payload)
4320 clear_hovered_windows =
true;
4322 if (clear_hovered_windows)
4351 IM_ASSERT(
GImGui != NULL &&
"No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
4356 for (
int n = g.
Hooks.
Size - 1; n >= 0; n--)
4363 ErrorCheckNewFrameSanityChecks();
4387 UpdateViewportsNewFrame();
4393 ImRect virtual_space(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
4460#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
4465#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
4509 UpdateKeyboardInputs();
4520 UpdateMouseInputs();
4586 UpdateDebugToolItemPicker();
4587 UpdateDebugToolStackQueries();
4592 DebugLog(
"(Auto-disabled ImGuiDebugLogFlags_EventClipper to avoid spamming)\n");
4601 Begin(
"Debug##Default");
4608static int IMGUI_CDECL ChildWindowComparer(
const void* lhs,
const void* rhs)
4626 for (
int i = 0; i < count; i++)
4630 AddWindowToSortBuffer(out_sorted_windows, child);
4665 IM_ASSERT(draw_list->
_VtxCurrentIdx < (1 << 16) &&
"Too many vertices in ImDrawList using 16-bit indices. Read comment above");
4670static void AddWindowToDrawData(
ImGuiWindow* window,
int layer)
4679 if (IsWindowActiveAndVisible(child))
4680 AddWindowToDrawData(child, layer);
4684static inline int GetWindowDisplayLayer(
ImGuiWindow* window)
4690static inline void AddRootWindowToDrawData(
ImGuiWindow* window)
4692 AddWindowToDrawData(window, GetWindowDisplayLayer(window));
4717 draw_data->
Valid =
true;
4724 for (
int n = 0; n < draw_lists->
Size; n++)
4742 window->
DrawList->
PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect);
4753static void ImGui::RenderDimmedBackgroundBehindWindow(
ImGuiWindow* window,
ImU32 col)
4783 ImGuiWindow* bottom_most_visible_window = parent_window;
4791 if (IsWindowActiveAndVisible(window) && GetWindowDisplayLayer(window) <= GetWindowDisplayLayer(parent_window))
4792 bottom_most_visible_window = window;
4794 return bottom_most_visible_window;
4797static void ImGui::RenderDimmedBackgrounds()
4800 ImGuiWindow* modal_window = GetTopMostAndVisiblePopupModal();
4803 const bool dim_bg_for_modal = (modal_window != NULL);
4805 if (!dim_bg_for_modal && !dim_bg_for_window_list)
4808 if (dim_bg_for_modal)
4811 ImGuiWindow* dim_behind_window = FindBottomMostVisibleWindowWithinBeginStack(modal_window);
4814 else if (dim_bg_for_window_list)
4826 bb.
Expand(-distance - 1.0f);
4848 ErrorCheckEndFrameSanityChecks();
4856#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
4884 if (is_delivered || is_elapsed)
4957 if (first_render_of_frame)
4958 RenderDimmedBackgrounds();
4968 if (IsWindowActiveAndVisible(window) && (window->
Flags &
ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_top_most[0] && window != windows_to_render_top_most[1])
4969 AddRootWindowToDrawData(window);
4971 for (
int n = 0; n <
IM_ARRAYSIZE(windows_to_render_top_most); n++)
4972 if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n]))
4973 AddRootWindowToDrawData(windows_to_render_top_most[n]);
5005 const char* text_display_end;
5006 if (hide_text_after_double_hash)
5009 text_display_end = text_end;
5012 const float font_size = g.
FontSize;
5013 if (text == text_display_end)
5014 return ImVec2(0.0f, font_size);
5015 ImVec2 text_size = font->
CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL);
5022 text_size.
x =
IM_FLOOR(text_size.
x + 0.99999f);
5031static void FindHoveredWindow()
5036 ImGuiWindow* hovered_window_ignoring_moving_window = NULL;
5054 bb.
Expand(padding_regular);
5056 bb.
Expand(padding_for_resize);
5070 if (hovered_window == NULL)
5071 hovered_window = window;
5074 hovered_window_ignoring_moving_window = window;
5075 if (hovered_window && hovered_window_ignoring_moving_window)
5228 ImVec2 size = ImFloor(size_arg);
5229 const int auto_fit_axises = ((size.
x == 0.0f) ? (1 <<
ImGuiAxis_X) : 0x00) | ((size.
y == 0.0f) ? (1 <<
ImGuiAxis_Y) : 0x00);
5231 size.
x = ImMax(content_avail.
x + size.
x, 4.0f);
5233 size.
y = ImMax(content_avail.
y + size.
y, 4.0f);
5237 const char* temp_window_name;
5246 bool ret =
Begin(temp_window_name, NULL, flags);
5272 return BeginChildEx(str_id, window->
GetID(str_id), size_arg, border, extra_flags);
5278 return BeginChildEx(NULL,
id, size_arg, border, extra_flags);
5298 sz.
x = ImMax(4.0f, sz.
x);
5300 sz.
y = ImMax(4.0f, sz.
y);
5369 if (settings->
Size.
x > 0 && settings->
Size.
y > 0)
5379 const bool child_flag_changed = new_is_explicit_child != window->
IsExplicitChild;
5380 if ((just_created || child_flag_changed) && !new_is_explicit_child)
5386 else if (!just_created && child_flag_changed && new_is_explicit_child)
5405 if (settings != NULL)
5408 ApplyWindowSettings(window, settings);
5419 if (window->
Size.
x <= 0.0f)
5421 if (window->
Size.
y <= 0.0f)
5433 window->
Flags = flags;
5441 InitOrLoadWindowSettings(window, settings);
5454 ImVec2 new_size = size_desired;
5481 new_size.
y = ImMax(new_size.
y, minimum_height);
5486static void CalcWindowContentSizes(
ImGuiWindow* window,
ImVec2* content_size_current,
ImVec2* content_size_ideal)
5488 bool preserve_old_content_sizes =
false;
5490 preserve_old_content_sizes =
true;
5492 preserve_old_content_sizes =
true;
5493 if (preserve_old_content_sizes)
5513 ImVec2 size_desired = size_contents + size_pad +
ImVec2(decoration_w_without_scrollbars, decoration_h_without_scrollbars);
5517 return size_desired;
5525 if (is_popup || is_menu)
5526 size_min = ImMin(size_min,
ImVec2(4.0f, 4.0f));
5533 ImVec2 size_auto_fit_after_constraint = CalcWindowSizeAfterConstraint(window, size_auto_fit);
5536 if (will_have_scrollbar_x)
5538 if (will_have_scrollbar_y)
5540 return size_auto_fit;
5546 ImVec2 size_contents_current;
5547 ImVec2 size_contents_ideal;
5548 CalcWindowContentSizes(window, &size_contents_current, &size_contents_ideal);
5549 ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, size_contents_ideal);
5550 ImVec2 size_final = CalcWindowSizeAfterConstraint(window, size_auto_fit);
5565 ImVec2 pos_min = ImLerp(corner_target, window->
Pos, corner_norm);
5566 ImVec2 pos_max = ImLerp(window->
Pos + window->
Size, corner_target, corner_norm);
5567 ImVec2 size_expected = pos_max - pos_min;
5568 ImVec2 size_constrained = CalcWindowSizeAfterConstraint(window, size_expected);
5570 if (corner_norm.
x == 0.0f)
5571 out_pos->
x -= (size_constrained.
x - size_expected.
x);
5572 if (corner_norm.
y == 0.0f)
5573 out_pos->
y -= (size_constrained.
y - size_expected.
y);
5574 *out_size = size_constrained;
5607static ImRect GetResizeBorderRect(
ImGuiWindow* window,
int border_n,
float perp_padding,
float thickness)
5610 if (thickness == 0.0f)
5634 int n = (int)dir + 4;
5643static bool ImGui::UpdateWindowManualResize(
ImGuiWindow* window,
const ImVec2& size_auto_fit,
int* border_held,
int resize_grip_count,
ImU32 resize_grip_col[4],
const ImRect& visibility_rect)
5653 bool ret_auto_fit =
false;
5656 const float grip_hover_inner_size =
IM_FLOOR(grip_draw_size * 0.75f);
5659 ImVec2 pos_target(FLT_MAX, FLT_MAX);
5660 ImVec2 size_target(FLT_MAX, FLT_MAX);
5667 for (
int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++)
5674 ImRect resize_rect(corner - def.
InnerDir * grip_hover_outer_size, corner + def.
InnerDir * grip_hover_inner_size);
5675 if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x);
5676 if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
5681 if (hovered || held)
5687 size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit);
5688 ret_auto_fit =
true;
5695 ImVec2 clamp_min =
ImVec2(def.
CornerPosN.
x == 1.0f ? visibility_rect.
Min.
x : -FLT_MAX, def.CornerPosN.y == 1.0f ? visibility_rect.Min.y : -FLT_MAX);
5696 ImVec2 clamp_max =
ImVec2(def.
CornerPosN.
x == 0.0f ? visibility_rect.
Max.
x : +FLT_MAX, def.CornerPosN.y == 0.0f ? visibility_rect.Max.y : +FLT_MAX);
5698 corner_target = ImClamp(corner_target, clamp_min, clamp_max);
5699 CalcResizePosSizeFromAnyCorner(window, corner_target, def.
CornerPosN, &pos_target, &size_target);
5703 if (resize_grip_n == 0 || held || hovered)
5706 for (
int border_n = 0; border_n < resize_border_count; border_n++)
5712 ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_HOVER_PADDING);
5717 if ((hovered && g.
HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
5721 *border_held = border_n;
5729 border_target = ImClamp(border_target, clamp_min, clamp_max);
5730 CalcResizePosSizeFromAnyCorner(window, border_target, ImMin(def.
SegmentN1, def.
SegmentN2), &pos_target, &size_target);
5748 if (nav_resize_dir.
x != 0.0f || nav_resize_dir.
y != 0.0f)
5750 const float NAV_RESIZE_SPEED = 600.0f;
5758 if (accum_floored.
x != 0.0f || accum_floored.
y != 0.0f)
5761 size_target = CalcWindowSizeAfterConstraint(window, window->
SizeFull + accum_floored);
5768 if (size_target.x != FLT_MAX)
5773 if (pos_target.x != FLT_MAX)
5775 window->
Pos = ImFloor(pos_target);
5780 return ret_auto_fit;
5783static inline void ClampWindowPos(
ImGuiWindow* window,
const ImRect& visibility_rect)
5789 window->
Pos = ImClamp(window->
Pos, visibility_rect.
Min - size_for_clamping, visibility_rect.
Max);
5792static void ImGui::RenderWindowOuterBorders(
ImGuiWindow* window)
5801 if (border_held != -1)
5804 ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f);
5818void ImGui::RenderWindowDecorations(
ImGuiWindow* window,
const ImRect& title_bar_rect,
bool title_bar_is_highlight,
bool handle_borders_and_resize_grips,
int resize_grip_count,
const ImU32 resize_grip_col[4],
float resize_grip_draw_size)
5838 RenderFrame(title_bar_rect.
Min, title_bar_rect.
Max, title_bar_col,
true, window_rounding);
5847 bool override_alpha =
false;
5852 override_alpha =
true;
5885 for (
int resize_grip_n = 0; resize_grip_n < resize_grip_count; resize_grip_n++)
5887 const ImU32 col = resize_grip_col[resize_grip_n];
5900 if (handle_borders_and_resize_grips)
5901 RenderWindowOuterBorders(window);
5906void ImGui::RenderWindowTitleBarContents(
ImGuiWindow* window,
const ImRect& title_bar_rect,
const char* name,
bool* p_open)
5912 const bool has_close_button = (p_open != NULL);
5927 ImVec2 collapse_button_pos;
5928 if (has_close_button)
5945 if (has_collapse_button)
5950 if (has_close_button)
5971 float pad_extend = ImMin(ImMax(pad_l, pad_r), title_bar_rect.
GetWidth() - pad_l - pad_r - text_size.
x);
5972 pad_l = ImMax(pad_l, pad_extend * centerness);
5973 pad_r = ImMax(pad_r, pad_extend * centerness);
5976 ImRect layout_r(title_bar_rect.
Min.
x + pad_l, title_bar_rect.
Min.
y, title_bar_rect.
Max.
x - pad_r, title_bar_rect.
Max.
y);
5981 marker_pos.
x = ImClamp(layout_r.Min.x + (layout_r.GetWidth() - text_size.
x) * style.
WindowTitleAlign.
x + text_size.
x, layout_r.Min.x, layout_r.Max.x);
5982 marker_pos.
y = (layout_r.Min.y + layout_r.Max.y) * 0.5f;
5983 if (marker_pos.
x > layout_r.Min.x)
5986 clip_r.Max.x = ImMin(clip_r.Max.x, marker_pos.
x - (
int)(marker_size_x * 0.5f));
6034 if (IsWindowWithinBeginStackOf(window, popup_window))
6037 if (IsWindowWithinBeginStackOf(window, parent))
6038 return popup_window;
6054 IM_ASSERT(name != NULL && name[0] !=
'\0');
6060 const bool window_just_created = (window == NULL);
6061 if (window_just_created)
6062 window = CreateNewWindow(name, flags);
6072 const bool first_begin_of_the_frame = (window->
LastFrameActive != current_frame);
6076 bool window_just_activated_by_user = (window->
LastFrameActive < current_frame - 1);
6080 window_just_activated_by_user |= (window->
PopupId != popup_ref.
PopupId);
6081 window_just_activated_by_user |= (window != popup_ref.
Window);
6083 window->
Appearing = window_just_activated_by_user;
6088 if (first_begin_of_the_frame)
6090 UpdateWindowInFocusOrderList(window, window_just_created, flags);
6099 flags = window->
Flags;
6115 window_stack_data.
Window = window;
6123 if (first_begin_of_the_frame)
6138 popup_ref.
Window = window;
6146 bool window_pos_set_by_api =
false;
6147 bool window_size_x_set_by_api =
false, window_size_y_set_by_api =
false;
6185 else if (first_begin_of_the_frame)
6195 if (first_begin_of_the_frame)
6202 window->
ClipRect =
ImVec4(-FLT_MAX, -FLT_MAX, +FLT_MAX, +FLT_MAX);
6213 bool window_title_visible_elsewhere =
false;
6215 window_title_visible_elsewhere =
true;
6216 if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->
Name) != 0)
6235 if (window_just_created && (!window_size_x_set_by_api || !window_size_y_set_by_api))
6245 if (!window_size_x_set_by_api)
6247 if (!window_size_y_set_by_api)
6258 SetCurrentWindow(window);
6274 bool use_current_size_for_scrollbar_x = window_just_created;
6275 bool use_current_size_for_scrollbar_y = window_just_created;
6289 use_current_size_for_scrollbar_y =
true;
6315 if (!window_size_x_set_by_api)
6318 use_current_size_for_scrollbar_x =
true;
6320 if (!window_size_y_set_by_api)
6323 use_current_size_for_scrollbar_y =
true;
6333 use_current_size_for_scrollbar_x =
true;
6338 use_current_size_for_scrollbar_y =
true;
6345 window->
SizeFull = CalcWindowSizeAfterConstraint(window, window->
SizeFull);
6351 if (window_just_activated_by_user)
6369 if (window_pos_with_pivot)
6373 else if ((flags &
ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_just_appearing_after_hidden_for_resize)
6383 ImRect visibility_rect(viewport_work_rect.
Min + visibility_padding, viewport_work_rect.
Max - visibility_padding);
6389 ClampWindowPos(window, visibility_rect);
6390 window->
Pos = ImFloor(window->
Pos);
6401 bool want_focus =
false;
6419 ImGuiWindow* blocking_modal = FindBlockingModal(window);
6427#ifdef IMGUI_ENABLE_TEST_ENGINE
6439 int border_held = -1;
6440 ImU32 resize_grip_col[4] = {};
6444 if (UpdateWindowManualResize(window, size_auto_fit, &border_held, resize_grip_count, &resize_grip_col[0], visibility_rect))
6445 use_current_size_for_scrollbar_x = use_current_size_for_scrollbar_y =
true;
6459 float size_x_for_scrollbars = use_current_size_for_scrollbar_x ? avail_size_from_current_frame.
x : avail_size_from_last_frame.
x;
6460 float size_y_for_scrollbars = use_current_size_for_scrollbar_y ? avail_size_from_current_frame.
y : avail_size_from_last_frame.
y;
6528 window->
Scroll = CalcNextScrollFromScrollTargetAndClamp(window);
6543 bool render_decorations_in_parent =
false;
6549 bool previous_child_overlapping = previous_child ? previous_child->
Rect().
Overlaps(window->
Rect()) :
false;
6552 render_decorations_in_parent =
true;
6554 if (render_decorations_in_parent)
6560 const bool handle_borders_and_resize_grips =
true;
6561 RenderWindowDecorations(window, title_bar_rect, title_bar_is_highlight, handle_borders_and_resize_grips, resize_grip_count, resize_grip_col, resize_grip_draw_size);
6563 if (render_decorations_in_parent)
6668#ifndef IMGUI_DISABLE_DEBUG_TOOLS
6674#ifdef IMGUI_ENABLE_TEST_ENGINE
6682 SetCurrentWindow(window);
6693 if (first_begin_of_the_frame)
6716 if (style.
Alpha <= 0.0f)
6731 bool skip_items =
false;
6793 for (
int n = cur_order; n < new_order; n++)
6807 if (current_front_window == window || current_front_window->
RootWindow == window)
6834 IM_ASSERT(window != NULL && behind_window != NULL);
6840 if (pos_wnd < pos_beh)
6842 size_t copy_bytes = (pos_beh - pos_wnd - 1) *
sizeof(
ImGuiWindow*);
6844 g.
Windows[pos_beh - 1] = window;
6848 size_t copy_bytes = (pos_wnd - pos_beh) *
sizeof(
ImGuiWindow*);
6905 if (under_this_window != NULL)
6914 start_idx = FindWindowFocusIndex(under_this_window) + offset;
6916 for (
int i = start_idx; i >= 0; i--)
6921 if (window != ignore_window && window->
WasActive)
6924 ImGuiWindow* focus_window = NavRestoreLastChildNavWindow(window);
6973 item_flags |= option;
6975 item_flags &= ~option;
6998 if (!was_disabled && disabled)
7003 if (was_disabled || disabled)
7059 while (last_window != window)
7061 last_window = window;
7063 if (popup_hierarchy)
7071 ImGuiWindow* window_root = GetCombinedRootWindow(window, popup_hierarchy);
7072 if (window_root == potential_parent)
7074 while (window != NULL)
7076 if (window == potential_parent)
7078 if (window == window_root)
7089 while (window != NULL)
7091 if (window == potential_parent)
7103 const int display_layer_delta = GetWindowDisplayLayer(potential_above) - GetWindowDisplayLayer(potential_below);
7104 if (display_layer_delta != 0)
7105 return display_layer_delta > 0;
7110 if (candidate_window == potential_above)
7112 if (candidate_window == potential_below)
7124 if (ref_window == NULL)
7132 cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
7138 result = (ref_window == cur_window);
7143 if (!IsWindowContentHoverable(ref_window, flags))
7157 if (ref_window == NULL)
7165 cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
7170 return (ref_window == cur_window);
7184 return window->
Size.
x;
7190 return window->
Size.
y;
7206 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond));
7212 window->
Pos = ImFloor(pos);
7214 if (offset.
x == 0.0f && offset.
y == 0.0f)
7238 return window->
Size;
7247 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond));
7345 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond));
7355 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond));
7389 IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond));
7505 NavUpdateAnyRequestFlag();
7573 if (g.DebugHookIdInfo ==
id)
7597 return window->
GetID(str_id);
7603 return window->
GetID(str_id_begin, str_id_end);
7609 return window->
GetID(ptr_id);
7696#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
7701 IM_ASSERT(
IsNamedKey(key) &&
"Support for user key indices was dropped in favor of ImGuiKey. Please update backend & user code.");
7706#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
7717static const char*
const GKeyNames[] =
7719 "Tab",
"LeftArrow",
"RightArrow",
"UpArrow",
"DownArrow",
"PageUp",
"PageDown",
7720 "Home",
"End",
"Insert",
"Delete",
"Backspace",
"Space",
"Enter",
"Escape",
7721 "LeftCtrl",
"LeftShift",
"LeftAlt",
"LeftSuper",
"RightCtrl",
"RightShift",
"RightAlt",
"RightSuper",
"Menu",
7722 "0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
7723 "I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
7724 "F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
"F8",
"F9",
"F10",
"F11",
"F12",
7725 "Apostrophe",
"Comma",
"Minus",
"Period",
"Slash",
"Semicolon",
"Equal",
"LeftBracket",
7726 "Backslash",
"RightBracket",
"GraveAccent",
"CapsLock",
"ScrollLock",
"NumLock",
"PrintScreen",
7727 "Pause",
"Keypad0",
"Keypad1",
"Keypad2",
"Keypad3",
"Keypad4",
"Keypad5",
"Keypad6",
7728 "Keypad7",
"Keypad8",
"Keypad9",
"KeypadDecimal",
"KeypadDivide",
"KeypadMultiply",
7729 "KeypadSubtract",
"KeypadAdd",
"KeypadEnter",
"KeypadEqual",
7730 "GamepadStart",
"GamepadBack",
7731 "GamepadFaceLeft",
"GamepadFaceRight",
"GamepadFaceUp",
"GamepadFaceDown",
7732 "GamepadDpadLeft",
"GamepadDpadRight",
"GamepadDpadUp",
"GamepadDpadDown",
7733 "GamepadL1",
"GamepadR1",
"GamepadL2",
"GamepadR2",
"GamepadL3",
"GamepadR3",
7734 "GamepadLStickLeft",
"GamepadLStickRight",
"GamepadLStickUp",
"GamepadLStickDown",
7735 "GamepadRStickLeft",
"GamepadRStickRight",
"GamepadRStickUp",
"GamepadRStickDown",
7736 "MouseLeft",
"MouseRight",
"MouseMiddle",
"MouseX1",
"MouseX2",
"MouseWheelX",
"MouseWheelY",
7737 "ModCtrl",
"ModShift",
"ModAlt",
"ModSuper",
7743#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
7744 IM_ASSERT((
IsNamedKey(key) || key ==
ImGuiKey_None) &&
"Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code.");
7749 if (io.
KeyMap[key] == -1)
7789 if (repeat_rate <= 0.0f)
7790 return (t0 < repeat_delay) && (t1 >= repeat_delay);
7791 const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate);
7792 const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate);
7793 const int count = count_t1 - count_t0;
7814 if (!key_data->
Down)
7842 routing_entry = &rt->
Entries[old_routing_idx];
7897 routing_data = &rt->
Entries[idx];
7898 if (routing_data->
Mods == mods)
7899 return routing_data;
7905 routing_data = &rt->
Entries[routing_data_idx];
7909 return routing_data;
7929 if (owner_id != 0 && g.
ActiveId == owner_id)
7939 for (
int next_score = 3; focused != NULL; next_score++)
7941 if (focused == location)
7980 const int score = CalcRoutingScore(g.
CurrentWindow, owner_id, flags);
7987 const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
7989 if (score < routing_data->RoutingNextScore)
8003 const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
8018 if (!key_data->
Down)
8034 if (!key_data->
Down)
8041 bool pressed = (t == 0.0f);
8044 float repeat_delay, repeat_rate;
8147 ImRect rect_clipped(r_min, r_max);
8164 if (lock_threshold < 0.0f)
8199 const float MOUSE_INVALID = -256000.0f;
8201 return p.
x >= MOUSE_INVALID && p.
y >= MOUSE_INVALID;
8221 if (lock_threshold < 0.0f)
8227 return ImVec2(0.0f, 0.0f);
8254static void UpdateAliasKey(
ImGuiKey key,
bool v,
float analog_value)
8273static void ImGui::UpdateKeyboardInputs()
8279#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
8284 IM_ASSERT((io.
KeysDown[n] ==
false ||
IsKeyDown((
ImGuiKey)n)) &&
"Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
8290 IM_ASSERT(g.
IO.
KeyMap[n] == -1 &&
"Backend is not allowed to write to io.KeyMap[0..511]!");
8320#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
8324 #define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f); io.KeysData[_KEY].AnalogValue = io.NavInputs[_NAV1]; } while (0)
8325 #define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2) do { io.KeysData[_KEY].Down = (io.NavInputs[_NAV1] > 0.0f) || (io.NavInputs[_NAV2] > 0.0f); io.KeysData[_KEY].AnalogValue = ImMax(io.NavInputs[_NAV1], io.NavInputs[_NAV2]); } while (0)
8355 io.
KeyMods = GetMergedModsFromKeys();
8383 if (!key_data->
Down)
8391static void ImGui::UpdateMouseInputs()
8420 bool is_repeated_click =
false;
8425 is_repeated_click =
true;
8427 if (is_repeated_click)
8452static void LockWheelingWindow(
ImGuiWindow* window,
float wheel_amount)
8476 for (
int axis = 0; axis < 2; axis++)
8477 if (wheel[axis] != 0.0f)
8484 const bool has_scrolling = (window->
ScrollMax[axis] != 0.0f);
8487 if (has_scrolling && !inputs_disabled)
8490 if (windows[0] == NULL && windows[1] == NULL)
8494 if (windows[0] == windows[1] || windows[0] == NULL || windows[1] == NULL)
8495 return windows[1] ? windows[1] : windows[0];
8511void ImGui::UpdateMouseWheel()
8522 LockWheelingWindow(NULL, 0.0f);
8531 if (!mouse_window || mouse_window->
Collapsed)
8538 LockWheelingWindow(mouse_window, wheel.
y);
8547 window->
Size = ImFloor(window->
Size * scale);
8574 if (wheel.
x == 0.0f && wheel.
y == 0.0f)
8583 bool do_scroll[2] = { wheel.
x != 0.0f && window->
ScrollMax.
x != 0.0f, wheel.
y != 0.0f && window->
ScrollMax.
y != 0.0f };
8588 LockWheelingWindow(window, wheel.
x);
8590 float scroll_step = ImFloor(ImMin(2 * window->
CalcFontSize(), max_step));
8595 LockWheelingWindow(window, wheel.
y);
8597 float scroll_step = ImFloor(ImMin(5 * window->
CalcFontSize(), max_step));
8615#ifndef IMGUI_DISABLE_DEBUG_TOOLS
8618 const char* input_source_names[] = {
"None",
"Mouse",
"Keyboard",
"Gamepad",
"Nav",
"Clipboard" };
8620 return input_source_names[source];
8622static void DebugPrintInputEvent(
const char* prefix,
const ImGuiInputEvent* e)
8648 bool mouse_moved =
false, mouse_wheeled =
false, key_changed =
false, text_inputted =
false;
8649 int mouse_button_changed = 0x00;
8660 if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted))
8670 if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled))
8673 mouse_button_changed |= (1 << button);
8678 if (trickle_fast_inputs && (mouse_moved || mouse_button_changed != 0))
8682 mouse_wheeled =
true;
8690 const int key_data_index = (int)(key_data - g.
IO.
KeysData);
8691 if (trickle_fast_inputs && key_data->
Down != e->
Key.
Down && (key_changed_mask.
TestBit(key_data_index) || text_inputted || mouse_button_changed != 0))
8696 key_changed_mask.
SetBit(key_data_index);
8699#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
8701 if (io.
KeyMap[key_data_index] != -1)
8708 if (trickle_fast_inputs && ((key_changed && trickle_interleaved_keys_and_text) || mouse_button_changed != 0 || mouse_moved || mouse_wheeled))
8712 if (trickle_interleaved_keys_and_text)
8713 text_inputted =
true;
8730 for (
int n = 0; n < event_n; n++)
8734#ifndef IMGUI_DISABLE_DEBUG_TOOLS
8737 DebugPrintInputEvent(n < event_n ?
"Processed" :
"Remaining", &g.
InputEventsQueue[n]);
8887 if (sz_io !=
sizeof(
ImGuiIO)) { error =
true;
IM_ASSERT(sz_io ==
sizeof(
ImGuiIO) &&
"Mismatched struct layout!"); }
8889 if (sz_vec2 !=
sizeof(
ImVec2)) { error =
true;
IM_ASSERT(sz_vec2 ==
sizeof(
ImVec2) &&
"Mismatched struct layout!"); }
8890 if (sz_vec4 !=
sizeof(
ImVec4)) { error =
true;
IM_ASSERT(sz_vec4 ==
sizeof(
ImVec4) &&
"Mismatched struct layout!"); }
8917#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
8922 IM_ASSERT(0 &&
"Code uses SetCursorPos()/SetCursorScreenPos() to extend window/parent boundaries. Please submit an item e.g. Dummy() to validate extent.");
8928static void ImGui::ErrorCheckNewFrameSanityChecks()
8942#ifdef __EMSCRIPTEN__
8953 IM_ASSERT(g.
IO.
Fonts->
IsBuilt() &&
"Font Atlas not built! Make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()");
8960#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
8974static void ImGui::ErrorCheckEndFrameSanityChecks()
8985 IM_ASSERT((key_mods == 0 || g.
IO.
KeyMods == key_mods) &&
"Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
9030 if (log_callback) log_callback(user_data,
"Recovered from missing EndChild() for '%s'", window->
Name);
9035 if (log_callback) log_callback(user_data,
"Recovered from missing End() for '%s'", window->
Name);
9056 if (log_callback) log_callback(user_data,
"Recovered from missing EndTabBar() in '%s'", window->
Name);
9061 if (log_callback) log_callback(user_data,
"Recovered from missing TreePop() in '%s'", window->
Name);
9066 if (log_callback) log_callback(user_data,
"Recovered from missing EndGroup() in '%s'", window->
Name);
9071 if (log_callback) log_callback(user_data,
"Recovered from missing PopID() in '%s'", window->
Name);
9076 if (log_callback) log_callback(user_data,
"Recovered from missing EndDisabled() in '%s'", window->
Name);
9086 if (log_callback) log_callback(user_data,
"Recovered from missing PopItemFlag() in '%s'", window->
Name);
9091 if (log_callback) log_callback(user_data,
"Recovered from missing PopStyleVar() in '%s'", window->
Name);
9096 if (log_callback) log_callback(user_data,
"Recovered from missing PopFocusScope() in '%s'", window->
Name);
9186 const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->
DC.
CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
9254 IM_ASSERT(
id != window->
ID &&
"Cannot have an empty ID at the root of a window. If you need an empty label, use ## and read the FAQ about how the ID Stack works!");
9258#ifdef IMGUI_ENABLE_TEST_ENGINE
9269 if (!is_rect_visible)
9275#ifndef IMGUI_DISABLE_DEBUG_TOOLS
9282 if (is_rect_visible)
9301 if (offset_from_start_x != 0.0f)
9303 if (spacing_w < 0.0f)
9310 if (spacing_w < 0.0f)
9426 const float w_item_one = ImMax(1.0f,
IM_FLOOR((w_full - (style.
ItemInnerSpacing.
x) * (components - 1)) / (
float)components));
9430 for (
int i = 0; i < components - 2; i++)
9432 window->
DC.
ItemWidth = (components == 1) ? w_item_last : w_item_one;
9457 w = ImMax(1.0f, region_max_x - window->
DC.
CursorPos.
x + w);
9473 if (size.
x < 0.0f || size.
y < 0.0f)
9478 else if (size.
x < 0.0f)
9483 else if (size.
y < 0.0f)
9625 if (group_contains_curr_active_id)
9627 else if (group_contains_prev_active_id)
9633 if (group_contains_curr_hovered_id)
9658static float CalcScrollEdgeSnap(
float target,
float snap_min,
float snap_max,
float snap_threshold,
float center_ratio)
9660 if (target <= snap_min + snap_threshold)
9661 return ImLerp(snap_min, target, center_ratio);
9662 if (target >= snap_max - snap_threshold)
9663 return ImLerp(target, snap_max, center_ratio);
9671 for (
int axis = 0; axis < 2; axis++)
9679 float snap_min = 0.0f;
9680 float snap_max = window->
ScrollMax[axis] + window->
SizeFull[axis] - decoration_size[axis];
9681 scroll_target = CalcScrollEdgeSnap(scroll_target, snap_min, snap_max, window->
ScrollTargetEdgeSnapDist[axis], center_ratio);
9683 scroll[axis] = scroll_target - center_ratio * (window->
SizeFull[axis] - decoration_size[axis]);
9685 scroll[axis] =
IM_FLOOR(ImMax(scroll[axis], 0.0f));
9687 scroll[axis] = ImMin(scroll[axis], window->
ScrollMax[axis]);
9725 const bool fully_visible_x = item_rect.
Min.
x >= scroll_rect.
Min.
x && item_rect.
Max.
x <= scroll_rect.
Max.
x;
9726 const bool fully_visible_y = item_rect.
Min.
y >= scroll_rect.
Min.
y && item_rect.
Max.
y <= scroll_rect.
Max.
y;
9732 if (item_rect.
Min.
x < scroll_rect.
Min.
x || !can_be_fully_visible_x)
9734 else if (item_rect.
Max.
x >= scroll_rect.
Max.
x)
9739 if (can_be_fully_visible_x)
9747 if (item_rect.
Min.
y < scroll_rect.
Min.
y || !can_be_fully_visible_y)
9749 else if (item_rect.
Max.
y >= scroll_rect.
Max.
y)
9754 if (can_be_fully_visible_y)
9760 ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
9774 return delta_scroll;
9839 IM_ASSERT(center_x_ratio >= 0.0f && center_x_ratio <= 1.0f);
9847 IM_ASSERT(center_y_ratio >= 0.0f && center_y_ratio <= 1.0f);
9917 char window_name[16];
9928 Begin(window_name, NULL, flags | extra_window_flags);
9953 va_start(args, fmt);
9999 IM_ASSERT(0 &&
"Cannot use IsPopupOpen() with a string id and ImGuiPopupFlags_AnyPopupLevel.");
10052 popup_ref.
Window = NULL;
10096 int popup_count_to_keep = 0;
10114 bool ref_window_is_descendent_of_popup =
false;
10119 ref_window_is_descendent_of_popup =
true;
10122 if (!ref_window_is_descendent_of_popup)
10137 int popup_count_to_keep;
10138 for (popup_count_to_keep = g.
OpenPopupStack.
Size; popup_count_to_keep > 0; popup_count_to_keep--)
10151 IMGUI_DEBUG_LOG_POPUP(
"[popup] ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup);
10159 if (restore_focus_to_window_under_popup)
10162 if (focus_window && !focus_window->
WasActive && popup_window)
10170 focus_window = NavRestoreLastChildNavWindow(focus_window);
10185 while (popup_idx > 0)
10189 bool close_parent =
false;
10192 close_parent =
true;
10224 bool is_open =
Begin(name, NULL, flags);
10267 const bool is_open =
Begin(name, p_open, flags);
10268 if (!is_open || (p_open && !*p_open))
10347 str_id =
"window_context";
10361 str_id =
"void_context";
10377 ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.
Min, r_outer.
Max - size);
10387 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n];
10388 if (n != -1 && dir == *last_dir)
10409 const ImGuiDir dir = (n == -1) ? *last_dir : dir_prefered_order[n];
10410 if (n != -1 && dir == *last_dir)
10427 pos.
x = ImMax(pos.
x, r_outer.
Min.
x);
10428 pos.
y = ImMax(pos.
y, r_outer.
Min.
y);
10440 return ref_pos +
ImVec2(2, 2);
10444 pos.
x = ImMax(ImMin(pos.
x + size.
x, r_outer.
Max.
x) - size.
x, r_outer.
Min.
x);
10445 pos.
y = ImMax(ImMin(pos.
y + size.
y, r_outer.
Max.
y) - size.
y, r_outer.
Min.
y);
10476 r_avoid =
ImRect(parent_window->
Pos.
x + horizontal_overlap, -FLT_MAX, parent_window->
Pos.
x + parent_window->
Size.
x - horizontal_overlap - parent_window->
ScrollbarSizes.
x, FLT_MAX);
10487 ImVec2 ref_pos = NavCalcPreferredRefPos();
10490 r_avoid =
ImRect(ref_pos.
x - 16, ref_pos.
y - 8, ref_pos.
x + 16, ref_pos.
y + 8);
10492 r_avoid =
ImRect(ref_pos.
x - 16, ref_pos.
y - 8, ref_pos.
x + 24 * sc, ref_pos.
y + 24 * sc);
10496 return window->
Pos;
10516 NavUpdateAnyRequestFlag();
10562static float inline NavScoreItemDistInterval(
float a0,
float a1,
float b0,
float b1)
10571static void inline NavClampRectToVisibleAreaForMoveDir(
ImGuiDir move_dir,
ImRect& r,
const ImRect& clip_rect)
10613 float dbx = NavScoreItemDistInterval(cand.
Min.
x, cand.
Max.
x, curr.
Min.
x, curr.
Max.
x);
10614 float dby = NavScoreItemDistInterval(ImLerp(cand.
Min.
y, cand.
Max.
y, 0.2f), ImLerp(cand.
Min.
y, cand.
Max.
y, 0.8f), ImLerp(curr.
Min.
y, curr.
Max.
y, 0.2f), ImLerp(curr.
Min.
y, curr.
Max.
y, 0.8f));
10615 if (dby != 0.0f && dbx != 0.0f)
10616 dbx = (dbx / 1000.0f) + ((dbx > 0.0f) ? +1.0f : -1.0f);
10626 float dax = 0.0f, day = 0.0f, dist_axial = 0.0f;
10627 if (dbx != 0.0f || dby != 0.0f)
10632 dist_axial = dist_box;
10635 else if (dcx != 0.0f || dcy != 0.0f)
10640 dist_axial = dist_center;
10649#if IMGUI_DEBUG_NAV_SCORING
10653 ImFormatString(buf,
IM_ARRAYSIZE(buf),
"dbox (%.2f,%.2f->%.4f)\ndcen (%.2f,%.2f->%.4f)\nd (%.2f,%.2f->%.4f)\nnav %c, quadrant %c", dbx, dby, dist_box, dcx, dcy, dist_center, dax, day, dist_axial,
"WENS"[g.
NavMoveDir],
"WENS"[quadrant]);
10673 bool new_best =
false;
10675 if (quadrant == move_dir)
10678 if (dist_box < result->DistBox)
10684 if (dist_box == result->
DistBox)
10687 if (dist_center < result->DistCenter)
10708 if (result->
DistBox == FLT_MAX && dist_axial < result->DistAxial)
10723 result->
Window = window;
10732static void ImGui::NavProcessItem()
10750 if (candidate_for_nav_default_focus)
10753 NavUpdateAnyRequestFlag();
10764 NavProcessItemForTabbingRequest(
id, item_flags, g.
NavMoveFlags);
10769 if (NavScoreItem(result))
10770 NavApplyItemToResult(result);
10773 const float VISIBLE_RATIO = 0.70f;
10826 else if (g.
NavId ==
id)
10837 NavUpdateAnyRequestFlag();
10843 NavApplyItemToResult(result);
10848 if (can_stop && g.
NavId ==
id)
10883 NavUpdateAnyRequestFlag();
10890 NavApplyItemToResult(result);
10891 NavUpdateAnyRequestFlag();
10898 NavUpdateAnyRequestFlag();
10927static void ImGui::NavSaveLastChildNavWindowIntoParent(
ImGuiWindow* nav_window)
10932 if (parent && parent != nav_window)
10952 if (prev_nav_window)
10967void ImGui::NavRestoreHighlightAfterMove()
10974static inline void ImGui::NavUpdateAnyRequestFlag()
10995 bool init_for_nav =
false;
10997 init_for_nav =
true;
10998 IMGUI_DEBUG_LOG_NAV(
"[nav] NavInitRequest: from NavInitWindow(), init_for_nav=%d, window=\"%s\", layer=%d\n", init_for_nav, window->
Name, g.
NavLayer);
11006 NavUpdateAnyRequestFlag();
11015static ImVec2 ImGui::NavCalcPreferredRefPos()
11034 ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
11039 return ImFloor(ImClamp(pos, viewport->
Pos, viewport->
Pos + viewport->
Size));
11046 float repeat_delay, repeat_rate;
11066static void ImGui::NavUpdate()
11078 if (nav_gamepad_active)
11079 for (
ImGuiKey key : nav_gamepad_keys_to_change_source)
11084 if (nav_keyboard_active)
11085 for (
ImGuiKey key : nav_keyboard_keys_to_change_source)
11104 bool set_mouse_pos =
false;
11107 set_mouse_pos =
true;
11113 NavSaveLastChildNavWindowIntoParent(g.
NavWindow);
11118 NavUpdateWindowing();
11125 NavUpdateCancelRequest();
11136 if (g.
ActiveId == 0 && activate_pressed)
11166 NavUpdateCreateMoveRequest();
11168 NavUpdateCreateTabbingRequest();
11169 NavUpdateAnyRequestFlag();
11189 if (nav_gamepad_active)
11194 SetScrollX(window, ImFloor(window->
Scroll.
x + scroll_dir.
x * scroll_speed * tweak_factor));
11195 if (scroll_dir.
y != 0.0f)
11196 SetScrollY(window, ImFloor(window->
Scroll.
y + scroll_dir.
y * scroll_speed * tweak_factor));
11201 if (!nav_keyboard_active && !nav_gamepad_active)
11218#if IMGUI_DEBUG_NAV_RECTS
11223 if (1) {
ImU32 col = (!g.
NavWindow->
Hidden) ?
IM_COL32(255,0,255,255) :
IM_COL32(255,0,0,255);
ImVec2 p = NavCalcPreferredRefPos();
char buf[32];
ImFormatString(buf, 32,
"%d", g.
NavLayer); draw_list->
AddCircleFilled(p, 3.0f, col); draw_list->
AddText(NULL, 13.0f, p +
ImVec2(8,-4), col, buf); }
11241 NavRestoreHighlightAfterMove();
11244void ImGui::NavUpdateCreateMoveRequest()
11280 float scoring_rect_offset_y = 0.0f;
11282 scoring_rect_offset_y = NavUpdatePageUpPageDown();
11283 if (scoring_rect_offset_y != 0.0f)
11290#if IMGUI_DEBUG_NAV_SCORING
11308 IMGUI_DEBUG_LOG_NAV(
"[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->
Name :
"<NULL>", g.NavLayer);
11325 inner_rect_rel.
Translate(CalcNextScrollFromScrollTargetAndClamp(window) - window->
Scroll);
11332 inner_rect_rel.
Min.
x = clamp_x ? (inner_rect_rel.
Min.
x + pad_x) : -FLT_MAX;
11333 inner_rect_rel.
Max.
x = clamp_x ? (inner_rect_rel.
Max.
x - pad_x) : +FLT_MAX;
11334 inner_rect_rel.
Min.
y = clamp_y ? (inner_rect_rel.
Min.
y + pad_y) : -FLT_MAX;
11335 inner_rect_rel.
Max.
y = clamp_y ? (inner_rect_rel.
Max.
y - pad_y) : +FLT_MAX;
11343 if (window != NULL)
11347 scoring_rect.
TranslateY(scoring_rect_offset_y);
11348 scoring_rect.
Min.
x = ImMin(scoring_rect.
Min.
x + 1.0f, scoring_rect.
Max.
x);
11349 scoring_rect.
Max.
x = scoring_rect.
Min.
x;
11358void ImGui::NavUpdateCreateTabbingRequest()
11375 if (nav_keyboard_active)
11389#if IMGUI_DEBUG_NAV_SCORING
11403 if (result == NULL)
11408 NavRestoreHighlightAfterMove();
11475 NavRestoreHighlightAfterMove();
11482static void ImGui::NavUpdateCancelRequest()
11499 NavRestoreHighlightAfterMove();
11510 NavRestoreHighlightAfterMove();
11530static float ImGui::NavUpdatePageUpPageDown()
11541 if (page_up_held == page_down_held && home_pressed == end_pressed)
11554 else if (home_pressed)
11556 else if (end_pressed)
11563 float nav_scoring_rect_offset_y = 0.0f;
11566 nav_scoring_rect_offset_y = -page_offset_y;
11573 nav_scoring_rect_offset_y = +page_offset_y;
11578 else if (home_pressed)
11583 nav_rect_rel.
Min.
y = nav_rect_rel.
Max.
y = 0.0f;
11585 nav_rect_rel.
Min.
x = nav_rect_rel.
Max.
x = 0.0f;
11590 else if (end_pressed)
11594 nav_rect_rel.
Min.
x = nav_rect_rel.
Max.
x = 0.0f;
11599 return nav_scoring_rect_offset_y;
11604static void ImGui::NavEndFrame()
11610 NavUpdateWindowingOverlay();
11617 NavUpdateCreateWrappingRequest();
11620static void ImGui::NavUpdateCreateWrappingRequest()
11625 bool do_forward =
false;
11675static int ImGui::FindWindowFocusIndex(
ImGuiWindow* window)
11685static ImGuiWindow* FindWindowNavFocusable(
int i_start,
int i_stop,
int dir)
11694static void NavUpdateWindowingHighlightWindow(
int focus_change_dir)
11702 ImGuiWindow* window_target = FindWindowNavFocusable(i_current + focus_change_dir, -INT_MAX, focus_change_dir);
11703 if (!window_target)
11704 window_target = FindWindowNavFocusable((focus_change_dir < 0) ? (g.
WindowsFocusOrder.
Size - 1) : 0, i_current, focus_change_dir);
11716static void ImGui::NavUpdateWindowing()
11722 bool apply_toggle_layer =
false;
11725 bool allow_windowing = (modal_window == NULL);
11726 if (!allow_windowing)
11743 const bool start_windowing_with_keyboard = allow_windowing && !g.
NavWindowingTarget && (keyboard_next_window || keyboard_prev_window);
11744 if (start_windowing_with_gamepad || start_windowing_with_keyboard)
11763 if (focus_change_dir != 0)
11765 NavUpdateWindowingHighlightWindow(focus_change_dir);
11774 apply_toggle_layer =
true;
11788 if (keyboard_next_window || keyboard_prev_window)
11789 NavUpdateWindowingHighlightWindow(keyboard_next_window ? -1 : +1);
11790 else if ((io.
KeyMods & shared_mods) != shared_mods)
11815 apply_toggle_layer =
true;
11828 if (nav_move_dir.
x != 0.0f || nav_move_dir.
y != 0.0f)
11830 const float NAV_MOVE_SPEED = 800.0f;
11835 if (accum_floored.
x != 0.0f || accum_floored.
y != 0.0f)
11848 NavRestoreHighlightAfterMove();
11849 apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window);
11865 if (apply_focus_window)
11894 NavRestoreLayer(new_nav_layer);
11895 NavRestoreHighlightAfterMove();
11901static const char* GetFallbackWindowNameForWindowingList(
ImGuiWindow* window)
11911void ImGui::NavUpdateWindowingOverlay()
11932 const char* label = window->
Name;
11934 label = GetFallbackWindowNameForWindowingList(window);
11982 bool source_drag_active =
false;
11984 ImGuiID source_parent_id = 0;
11988 if (source_id != 0)
12042 source_id =
ImHashStr(
"#SourceExtern");
12043 source_drag_active =
true;
12046 if (source_drag_active)
12109 IM_ASSERT((data != NULL && data_size > 0) || (data == NULL && data_size == 0));
12123 memcpy(payload.
Data, data, data_size);
12125 else if (data_size > 0)
12130 memcpy(payload.
Data, data, data_size);
12134 payload.
Data = NULL;
12136 payload.
DataSize = (int)data_size;
12214 if (type != NULL && !payload.
IsDataType(type))
12231 payload.
Preview = was_accepted_previously;
12277static inline void LogTextV(
ImGuiContext& g,
const char* fmt, va_list args)
12298 va_start(args, fmt);
12299 LogTextV(g, fmt, args);
12309 LogTextV(g, fmt, args);
12344 const char* text_remaining = text;
12349 const char* line_start = text_remaining;
12350 const char* line_end =
ImStreolRange(line_start, text_end);
12351 const bool is_last_line = (line_end == text_end);
12352 if (line_start != line_end || !is_last_line)
12354 const int line_length = (int)(line_end - line_start);
12356 LogText(
"%*s%.*s", indentation,
"", line_length, line_start);
12358 if (*line_end ==
'\n')
12366 text_remaining = line_end + 1;
12404#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
12422 if (!filename || !filename[0])
12462#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
12493#ifndef IMGUI_DISABLE_TTY_FUNCTIONS
12496 const bool log_to_tty =
false;
12499 const bool log_to_clipboard =
Button(
"Log To Clipboard");
SameLine();
12511 if (log_to_clipboard)
12536void ImGui::UpdateSettings()
12614 size_t file_data_size = 0;
12618 if (file_data_size > 0)
12634 ini_size = strlen(ini_data);
12637 char*
const buf_end = buf + ini_size;
12638 memcpy(buf, ini_data, ini_size);
12647 void* entry_data = NULL;
12650 char* line_end = NULL;
12651 for (
char* line = buf; line < buf_end; line = line_end + 1)
12654 while (*line ==
'\n' || *line ==
'\r')
12657 while (line_end < buf_end && *line_end !=
'\n' && *line_end !=
'\r')
12660 if (line[0] ==
';')
12662 if (line[0] ==
'[' && line_end > line && line_end[-1] ==
']')
12666 const char* name_end = line_end - 1;
12667 const char* type_start = line + 1;
12668 char* type_end = (
char*)(
void*)
ImStrchrRange(type_start, name_end,
']');
12669 const char* name_start = type_end ?
ImStrchrRange(type_end + 1, name_end,
'[') : NULL;
12670 if (!type_end || !name_start)
12675 entry_data = entry_handler ? entry_handler->
ReadOpenFn(&g, entry_handler, name_start) : NULL;
12677 else if (entry_handler != NULL && entry_data != NULL)
12680 entry_handler->
ReadLineFn(&g, entry_handler, entry_data, line);
12686 memcpy(buf, ini_data, ini_size);
12701 size_t ini_data_size = 0;
12706 ImFileWrite(ini_data,
sizeof(
char), ini_data_size, f);
12731#if !IMGUI_DEBUG_INI_SETTINGS
12734 if (
const char* p = strstr(name,
"###"))
12737 const size_t name_len = strlen(name);
12744 memcpy(settings->
GetName(), name, name_len + 1);
12755 if (settings->
ID ==
id)
12774 if (window != NULL)
12777 InitOrLoadWindowSettings(window, NULL);
12787 g.
Windows[i]->SettingsOffset = -1;
12801 return (
void*)settings;
12809 if (sscanf(line,
"Pos=%i,%i", &x, &y) == 2) { settings->
Pos =
ImVec2ih((
short)x, (
short)y); }
12810 else if (sscanf(line,
"Size=%i,%i", &x, &y) == 2) { settings->
Size =
ImVec2ih((
short)x, (
short)y); }
12811 else if (sscanf(line,
"Collapsed=%d", &i) == 1) { settings->
Collapsed = (i != 0); }
12822 ApplyWindowSettings(window, settings);
12858 const char* settings_name = settings->
GetName();
12875 for (
int n = 0; n < count; n++)
12901static void ImGui::UpdateViewportsNewFrame()
12910 main_viewport->
Pos =
ImVec2(0.0f, 0.0f);
12936#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS)
12939#pragma comment(lib, "user32")
12940#pragma comment(lib, "kernel32")
12945static const char* GetClipboardTextFn_DefaultImpl(
void* user_data_ctx)
12949 if (!::OpenClipboard(NULL))
12951 HANDLE wbuf_handle = ::GetClipboardData(CF_UNICODETEXT);
12952 if (wbuf_handle == NULL)
12954 ::CloseClipboard();
12957 if (
const WCHAR* wbuf_global = (
const WCHAR*)::GlobalLock(wbuf_handle))
12959 int buf_len = ::WideCharToMultiByte(CP_UTF8, 0, wbuf_global, -1, NULL, 0, NULL, NULL);
12963 ::GlobalUnlock(wbuf_handle);
12964 ::CloseClipboard();
12968static void SetClipboardTextFn_DefaultImpl(
void*,
const char* text)
12970 if (!::OpenClipboard(NULL))
12972 const int wbuf_length = ::MultiByteToWideChar(CP_UTF8, 0, text, -1, NULL, 0);
12973 HGLOBAL wbuf_handle = ::GlobalAlloc(GMEM_MOVEABLE, (SIZE_T)wbuf_length *
sizeof(WCHAR));
12974 if (wbuf_handle == NULL)
12976 ::CloseClipboard();
12979 WCHAR* wbuf_global = (WCHAR*)::GlobalLock(wbuf_handle);
12980 ::MultiByteToWideChar(CP_UTF8, 0, text, -1, wbuf_global, wbuf_length);
12981 ::GlobalUnlock(wbuf_handle);
12982 ::EmptyClipboard();
12983 if (::SetClipboardData(CF_UNICODETEXT, wbuf_handle) == NULL)
12984 ::GlobalFree(wbuf_handle);
12985 ::CloseClipboard();
12988#elif defined(__APPLE__) && TARGET_OS_OSX && defined(IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS)
12990#include <Carbon/Carbon.h>
12991static PasteboardRef main_clipboard = 0;
12995static void SetClipboardTextFn_DefaultImpl(
void*,
const char* text)
12997 if (!main_clipboard)
12998 PasteboardCreate(kPasteboardClipboard, &main_clipboard);
12999 PasteboardClear(main_clipboard);
13000 CFDataRef cf_data = CFDataCreate(kCFAllocatorDefault, (
const UInt8*)text, strlen(text));
13003 PasteboardPutItemFlavor(main_clipboard, (PasteboardItemID)1, CFSTR(
"public.utf8-plain-text"), cf_data, 0);
13004 CFRelease(cf_data);
13008static const char* GetClipboardTextFn_DefaultImpl(
void* user_data_ctx)
13011 if (!main_clipboard)
13012 PasteboardCreate(kPasteboardClipboard, &main_clipboard);
13013 PasteboardSynchronize(main_clipboard);
13015 ItemCount item_count = 0;
13016 PasteboardGetItemCount(main_clipboard, &item_count);
13017 for (ItemCount i = 0; i < item_count; i++)
13019 PasteboardItemID item_id = 0;
13020 PasteboardGetItemIdentifier(main_clipboard, i + 1, &item_id);
13021 CFArrayRef flavor_type_array = 0;
13022 PasteboardCopyItemFlavors(main_clipboard, item_id, &flavor_type_array);
13023 for (CFIndex j = 0, nj = CFArrayGetCount(flavor_type_array); j < nj; j++)
13026 if (PasteboardCopyItemFlavorData(main_clipboard, item_id, CFSTR(
"public.utf8-plain-text"), &cf_data) == noErr)
13029 int length = (int)CFDataGetLength(cf_data);
13033 CFRelease(cf_data);
13044static const char* GetClipboardTextFn_DefaultImpl(
void* user_data_ctx)
13050static void SetClipboardTextFn_DefaultImpl(
void* user_data_ctx,
const char* text)
13054 const char* text_end = text + strlen(text);
13063#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS)
13067#pragma comment(lib, "imm32")
13078 if (HIMC himc = ::ImmGetContext(hwnd))
13080 COMPOSITIONFORM composition_form = {};
13081 composition_form.ptCurrentPos.x = (LONG)data->InputPos.x;
13082 composition_form.ptCurrentPos.y = (LONG)data->InputPos.y;
13083 composition_form.dwStyle = CFS_FORCE_POSITION;
13084 ::ImmSetCompositionWindow(himc, &composition_form);
13085 CANDIDATEFORM candidate_form = {};
13086 candidate_form.dwStyle = CFS_CANDIDATEPOS;
13087 candidate_form.ptCurrentPos.x = (LONG)data->InputPos.x;
13088 candidate_form.ptCurrentPos.y = (LONG)data->InputPos.y;
13089 ::ImmSetCandidateWindow(himc, &candidate_form);
13090 ::ImmReleaseContext(hwnd, himc);
13123#ifndef IMGUI_DISABLE_DEBUG_TOOLS
13132 float alpha_mul = 1.0f;
13142 thumb_r =
ImRect(ImFloor(off + thumb_r.
Min * scale), ImFloor(off + thumb_r.
Max * scale));
13155static void RenderViewportsThumbnails()
13161 float SCALE = 1.0f / 8.0f;
13162 ImRect bb_full(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
13164 bb_full.Add(g.
Viewports[n]->GetMainRect());
13166 ImVec2 off = p - bb_full.Min * SCALE;
13170 ImRect viewport_draw_bb(off + (viewport->
Pos) * SCALE, off + (viewport->
Pos + viewport->
Size) * SCALE);
13180 const float key_rounding = 3.0f;
13183 const float key_face_rounding = 2.0f;
13185 const ImVec2 key_step =
ImVec2(key_size.
x - 1.0f, key_size.
y - 1.0f);
13186 const float key_row_offset = 9.0f;
13189 ImVec2 board_max =
ImVec2(board_min.
x + 3 * key_step.
x + 2 * key_row_offset + 10.0f, board_min.
y + 3 * key_step.
y + 10.0f);
13190 ImVec2 start_pos =
ImVec2(board_min.
x + 5.0f - key_step.
x, board_min.
y);
13192 struct KeyLayoutData {
int Row, Col;
const char* Label;
ImGuiKey Key; };
13193 const KeyLayoutData keys_to_display[] =
13195 { 0, 0,
"",
ImGuiKey_Tab }, { 0, 1,
"Q",
ImGuiKey_Q }, { 0, 2,
"W",
ImGuiKey_W }, { 0, 3,
"E",
ImGuiKey_E }, { 0, 4,
"R",
ImGuiKey_R },
13196 { 1, 0,
"",
ImGuiKey_CapsLock }, { 1, 1,
"A",
ImGuiKey_A }, { 1, 2,
"S",
ImGuiKey_S }, { 1, 3,
"D",
ImGuiKey_D }, { 1, 4,
"F",
ImGuiKey_F },
13197 { 2, 0,
"",
ImGuiKey_LeftShift },{ 2, 1,
"Z",
ImGuiKey_Z }, { 2, 2,
"X",
ImGuiKey_X }, { 2, 3,
"C",
ImGuiKey_C }, { 2, 4,
"V",
ImGuiKey_V }
13202 Dummy(board_max - board_min);
13206 for (
int n = 0; n <
IM_ARRAYSIZE(keys_to_display); n++)
13208 const KeyLayoutData* key_data = &keys_to_display[n];
13209 ImVec2 key_min =
ImVec2(start_pos.
x + key_data->Col * key_step.
x + key_data->Row * key_row_offset, start_pos.
y + key_data->Row * key_step.
y);
13210 ImVec2 key_max = key_min + key_size;
13212 draw_list->
AddRect(key_min, key_max,
IM_COL32(24, 24, 24, 255), key_rounding);
13213 ImVec2 face_min =
ImVec2(key_min.
x + key_face_pos.
x, key_min.
y + key_face_pos.
y);
13214 ImVec2 face_max =
ImVec2(face_min.
x + key_face_size.
x, face_min.
y + key_face_size.
y);
13217 ImVec2 label_min =
ImVec2(key_min.
x + key_label_pos.
x, key_min.
y + key_label_pos.
y);
13218 draw_list->
AddText(label_min,
IM_COL32(64, 64, 64, 255), key_data->Label);
13228 Text(
"Text: \"%s\"", str);
13236 for (
const char* p = str; *p != 0; )
13241 Text(
"%d", (
int)(p - str));
13243 for (
int byte_index = 0; byte_index < c_utf8_len; byte_index++)
13245 if (byte_index > 0)
13247 Text(
"0x%02X", (
int)(
unsigned char)p[byte_index]);
13255 Text(
"U+%04X", (
int)c);
13262static void MetricsHelpMarker(
const char* desc)
13277 for (
int i = 0; i < atlas->
Fonts.
Size; i++)
13322 enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentIdeal, WRT_ContentRegionRect, WRT_Count };
13323 const char* wrt_rects_names[WRT_Count] = {
"OuterRect",
"OuterRectClipped",
"InnerRect",
"InnerClipRect",
"WorkRect",
"Content",
"ContentIdeal",
"ContentRegionRect" };
13324 enum { TRT_OuterRect, TRT_InnerRect, TRT_WorkRect, TRT_HostClipRect, TRT_InnerClipRect, TRT_BackgroundClipRect, TRT_ColumnsRect, TRT_ColumnsWorkRect, TRT_ColumnsClipRect, TRT_ColumnsContentHeadersUsed, TRT_ColumnsContentHeadersIdeal, TRT_ColumnsContentFrozen, TRT_ColumnsContentUnfrozen, TRT_Count };
13325 const char* trt_rects_names[TRT_Count] = {
"OuterRect",
"InnerRect",
"WorkRect",
"HostClipRect",
"InnerClipRect",
"BackgroundClipRect",
"ColumnsRect",
"ColumnsWorkRect",
"ColumnsClipRect",
"ColumnsContentHeadersUsed",
"ColumnsContentHeadersIdeal",
"ColumnsContentFrozen",
"ColumnsContentUnfrozen" };
13336 if (rect_type == TRT_OuterRect) {
return table->
OuterRect; }
13337 else if (rect_type == TRT_InnerRect) {
return table->
InnerRect; }
13338 else if (rect_type == TRT_WorkRect) {
return table->
WorkRect; }
13339 else if (rect_type == TRT_HostClipRect) {
return table->
HostClipRect; }
13340 else if (rect_type == TRT_InnerClipRect) {
return table->
InnerClipRect; }
13341 else if (rect_type == TRT_BackgroundClipRect) {
return table->
BgClipRect; }
13355 if (rect_type == WRT_OuterRect) {
return window->
Rect(); }
13356 else if (rect_type == WRT_OuterRectClipped) {
return window->
OuterRectClipped; }
13357 else if (rect_type == WRT_InnerRect) {
return window->
InnerRect; }
13358 else if (rect_type == WRT_InnerClipRect) {
return window->
InnerClipRect; }
13359 else if (rect_type == WRT_WorkRect) {
return window->
WorkRect; }
13362 else if (rect_type == WRT_ContentRegionRect) {
return window->
ContentRegionRect; }
13371 bool show_encoding_viewer =
TreeNode(
"UTF-8 Encoding viewer");
13373 MetricsHelpMarker(
"You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct.");
13374 if (show_encoding_viewer)
13376 static char buf[100] =
"";
13388 MetricsHelpMarker(
"Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
13393 MetricsHelpMarker(
"You can also call ImGui::ShowDebugLogWindow() from your code.");
13398 MetricsHelpMarker(
"You can also call ImGui::ShowStackToolWindow() from your code.");
13409 for (
int rect_n = 0; rect_n < WRT_Count; rect_n++)
13412 Text(
"(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) %s", r.
Min.
x, r.
Min.
y, r.
Max.
x, r.
Max.
y, r.
GetWidth(), r.
GetHeight(), wrt_rects_names[rect_n]);
13431 GetForegroundDrawList()->
AddRect(table->
OuterRect.
Min -
ImVec2(1, 1), table->
OuterRect.
Max +
ImVec2(1, 1),
IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
13434 for (
int rect_n = 0; rect_n < TRT_Count; rect_n++)
13436 if (rect_n >= TRT_ColumnsRect)
13438 if (rect_n != TRT_ColumnsRect && rect_n != TRT_ColumnsClipRect)
13440 for (
int column_n = 0; column_n < table->
ColumnsCount; column_n++)
13442 ImRect r = Funcs::GetTableRect(table, rect_n, column_n);
13443 ImFormatString(buf,
IM_ARRAYSIZE(buf),
"(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) Col %d %s", r.
Min.
x, r.
Min.
y, r.
Max.
x, r.
Max.
y, r.
GetWidth(), r.
GetHeight(), column_n, trt_rects_names[rect_n]);
13446 GetForegroundDrawList()->
AddRect(r.
Min -
ImVec2(1, 1), r.
Max +
ImVec2(1, 1),
IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
13451 ImRect r = Funcs::GetTableRect(table, rect_n, -1);
13452 ImFormatString(buf,
IM_ARRAYSIZE(buf),
"(%6.1f,%6.1f) (%6.1f,%6.1f) Size (%6.1f,%6.1f) %s", r.
Min.
x, r.
Min.
y, r.
Max.
x, r.
Max.
y, r.
GetWidth(), r.
GetHeight(), trt_rects_names[rect_n]);
13455 GetForegroundDrawList()->
AddRect(r.
Min -
ImVec2(1, 1), r.
Max +
ImVec2(1, 1),
IM_COL32(255, 255, 0, 255), 0.0f, 0, 2.0f);
13471 if (
TreeNode(
"By submission order (begin stack)"))
13479 struct Func {
static int IMGUI_CDECL WindowComparerByBeginOrder(
const void* lhs,
const void* rhs) {
return ((
int)(*(
const ImGuiWindow*
const *)lhs)->BeginOrderWithinContext - (*(
const ImGuiWindow*
const*)rhs)->BeginOrderWithinContext); } };
13480 ImQsort(temp_buffer.
Data, (
size_t)temp_buffer.
Size,
sizeof(
ImGuiWindow*), Func::WindowComparerByBeginOrder);
13489 int drawlist_count = 0;
13490 for (
int viewport_i = 0; viewport_i < g.
Viewports.
Size; viewport_i++)
13491 drawlist_count += g.
Viewports[viewport_i]->DrawDataBuilder.GetDrawListCount();
13492 if (
TreeNode(
"DrawLists",
"DrawLists (%d)", drawlist_count))
13496 for (
int viewport_i = 0; viewport_i < g.
Viewports.
Size; viewport_i++)
13510 RenderViewportsThumbnails();
13525 BulletText(
"PopupID: %08x, Window: '%s' (%s%s), BackupNavWindow '%s', ParentWindow '%s'",
13570#ifdef IMGUI_HAS_DOCK
13614#ifdef IMGUI_HAS_DOCK
13627 Text(
"KEYBOARD/GAMEPAD/MOUSE KEYS");
13632#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
13633 struct funcs {
static bool IsLegacyNativeDupe(
ImGuiKey) {
return false; } };
13635 struct funcs {
static bool IsLegacyNativeDupe(
ImGuiKey key) {
return key < 512 &&
GetIO().
KeyMap[key] != -1; } };
13647 Text(
"MOUSE STATE");
13653 Text(
"Mouse pos: <INVALID>");
13664 Text(
"MOUSE WHEELING");
13673 Text(
"KEY OWNERS");
13691 Text(
"SHORTCUT ROUTING");
13701 char key_chord_name[64];
13792 for (
int column_n = 0; column_n < table->
ColumnsCount; column_n++)
13808#ifdef IMGUI_HAS_DOCK
13810 if (show_docking_nodes && g.
IO.
KeyCtrl)
13821 if (!
TreeNode((
void*)(uintptr_t)columns->
ID,
"Columns Id: 0x%08X, Count: %d, Flags: 0x%04X", columns->
ID, columns->
Count, columns->
Flags))
13824 for (
int column_n = 0; column_n < columns->
Columns.
Size; column_n++)
13854 TextDisabled(
"Warning: owning Window is inactive. This DrawList is not being rendered!");
13858 if (pcmd->UserCallback)
13860 BulletText(
"Callback %p, user_data %p", pcmd->UserCallback, pcmd->UserCallbackData);
13866 pcmd->ElemCount / 3, (
void*)(intptr_t)pcmd->TextureId,
13867 pcmd->ClipRect.x, pcmd->ClipRect.y, pcmd->ClipRect.z, pcmd->ClipRect.w);
13871 if (!pcmd_node_open)
13878 float total_area = 0.0f;
13879 for (
unsigned int idx_n = pcmd->IdxOffset; idx_n < pcmd->IdxOffset + pcmd->ElemCount; )
13882 for (
int n = 0; n < 3; n++, idx_n++)
13883 triangle[n] = vtx_buffer[idx_buffer ? idx_buffer[idx_n] : idx_n].
pos;
13884 total_area +=
ImTriangleArea(triangle[0], triangle[1], triangle[2]);
13888 ImFormatString(buf,
IM_ARRAYSIZE(buf),
"Mesh: ElemCount: %d, VtxOffset: +%d, IdxOffset: +%d, Area: ~%0.f px", pcmd->ElemCount, pcmd->VtxOffset, pcmd->IdxOffset, total_area);
13895 clipper.
Begin(pcmd->ElemCount / 3);
13896 while (clipper.
Step())
13899 char* buf_p = buf, * buf_end = buf +
IM_ARRAYSIZE(buf);
13901 for (
int n = 0; n < 3; n++, idx_i++)
13903 const ImDrawVert& v = vtx_buffer[idx_buffer ? idx_buffer[idx_i] : idx_i];
13904 triangle[n] = v.
pos;
13905 buf_p +=
ImFormatString(buf_p, buf_end - buf_p,
"%s %04d: pos (%8.2f,%8.2f), uv (%.6f,%.6f), col %08X\n",
13913 fg_draw_list->
Flags &= ~ImDrawListFlags_AntiAliasedLines;
13915 fg_draw_list->
Flags = backup_flags;
13930 ImRect vtxs_rect(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX);
13932 out_draw_list->
Flags &= ~ImDrawListFlags_AntiAliasedLines;
13939 for (
int n = 0; n < 3; n++, idx_n++)
13940 vtxs_rect.
Add((triangle[n] = vtx_buffer[idx_buffer ? idx_buffer[idx_n] : idx_n].
pos));
13947 out_draw_list->
AddRect(ImFloor(clip_rect.
Min), ImFloor(clip_rect.
Max),
IM_COL32(255, 0, 255, 255));
13948 out_draw_list->
AddRect(ImFloor(vtxs_rect.
Min), ImFloor(vtxs_rect.
Max),
IM_COL32(0, 255, 255, 255));
13950 out_draw_list->
Flags = backup_flags;
13956 bool opened =
TreeNode(font,
"Font: \"%s\"\n%.2f px, %d glyphs, %d file(s)",
13966 Text(
"The quick brown fox jumps over the lazy dog");
13971 DragFloat(
"Font scale", &font->
Scale, 0.005f, 0.3f, 2.0f,
"%.1f");
13973 "Note than the default embedded font is NOT meant to be scaled.\n\n"
13974 "Font are currently rendered into bitmaps at a given size at the time of building the atlas. "
13975 "You may oversample them to get some flexibility with scaling. "
13976 "You can also render at multiple sizes and select which one to use at runtime.\n\n"
13977 "(Glimmer of hope: the atlas system will be rewritten in the future to make scaling more flexible.)");
13987 BulletText(
"Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d, Offset: (%.1f,%.1f)",
13988 config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH, cfg->GlyphOffset.x, cfg->GlyphOffset.y);
13995 const float cell_size = font->
FontSize * 1;
14004 base += 4096 - 256;
14009 for (
unsigned int n = 0; n < 256; n++)
14014 if (!
TreeNode((
void*)(intptr_t)base,
"U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ?
"glyphs" :
"glyph"))
14019 for (
unsigned int n = 0; n < 256; n++)
14023 ImVec2 cell_p1(base_pos.
x + (n % 16) * (cell_size + cell_spacing), base_pos.
y + (n / 16) * (cell_size + cell_spacing));
14024 ImVec2 cell_p2(cell_p1.
x + cell_size, cell_p1.
y + cell_size);
14029 font->
RenderChar(draw_list, cell_size, cell_p1, glyph_col, (
ImWchar)(base + n));
14036 Dummy(
ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
14050 Text(
"Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->
X0, glyph->
Y0, glyph->
X1, glyph->
Y1);
14051 Text(
"UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->
U0, glyph->
V0, glyph->
U1, glyph->
V1);
14057 if (!
TreeNode(label,
"%s: %d entries, %d bytes", label, storage->
Data.Size, storage->
Data.size_in_bytes()))
14059 for (
int n = 0; n < storage->
Data.Size; n++)
14075 p +=
ImFormatString(p, buf_end - p,
"%s 0x%08X (%d tabs)%s", label, tab_bar->
ID, tab_bar->
Tabs.
Size, is_active ?
"" :
" *Inactive*");
14077 for (
int tab_n = 0; tab_n < ImMin(tab_bar->
Tabs.
Size, 3); tab_n++)
14085 bool open =
TreeNode(label,
"%s", buf);
14096 for (
int tab_n = 0; tab_n < tab_bar->
Tabs.
Size; tab_n++)
14102 Text(
"%02d%c Tab 0x%08X '%s' Offset: %.2f, Width: %.2f/%.2f",
14113 if (
TreeNode(
"viewport0",
"Viewport #%d", 0))
14116 BulletText(
"Main Pos: (%.0f,%.0f), Size: (%.0f,%.0f)\nWorkArea Offset Left: %.0f Top: %.0f, Right: %.0f, Bottom: %.0f",
14132 if (window == NULL)
14139 const bool is_active = window->
WasActive;
14142 const bool open =
TreeNodeEx(label, tree_node_flags,
"%s '%s'%s", label, window->
Name, is_active ?
"" :
" *Inactive*");
14150 TextDisabled(
"Note: some memory buffers have been compacted/freed.");
14154 BulletText(
"Pos: (%.1f,%.1f), Size: (%.1f,%.1f), ContentSize (%.1f,%.1f) Ideal (%.1f,%.1f)", window->
Pos.
x, window->
Pos.
y, window->
Size.
x, window->
Size.
y, window->
ContentSize.
x, window->
ContentSize.
y, window->
ContentSizeIdeal.
x, window->
ContentSizeIdeal.
y);
14155 BulletText(
"Flags: 0x%08X (%s%s%s%s%s%s%s%s%s..)", flags,
14189 Text(
"0x%08X \"%s\" Pos (%d,%d) Size (%d,%d) Collapsed=%d",
14197 if (!
TreeNode(label,
"%s (%d)", label, windows->
Size))
14199 for (
int i = windows->
Size - 1; i >= 0; i--)
14211 for (
int i = 0; i < windows_size; i++)
14233 va_start(args, fmt);
14261 Text(
"Log events:");
14282 while (clipper.
Step())
14290 for (
const char* p = line_begin; p < line_end - 10; p++)
14293 if (p[0] !=
'0' || (p[1] !=
'x' && p[1] !=
'X') || sscanf(p + 2,
"%X", &
id) != 1)
14314static const ImU32 DEBUG_LOCATE_ITEM_COLOR =
IM_COL32(0, 255, 0, 255);
14343 draw_list->
AddLine(p1, p2, DEBUG_LOCATE_ITEM_COLOR);
14347void ImGui::UpdateDebugToolItemPicker()
14364 for (
int mouse_button = 0; mouse_button < 3; mouse_button++)
14370 Text(
"HoveredId: 0x%08X", hovered_id);
14371 Text(
"Press ESC to abort picking.");
14372 const char* mouse_button_names[] = {
"Left",
"Right",
"Middle" };
14373 if (change_mapping)
14374 Text(
"Remap w/ Ctrl+Shift: click anywhere to select new mouse button.");
14381void ImGui::UpdateDebugToolStackQueries()
14394 if (tool->
QueryId != query_id)
14405 if (stack_level >= 0 && stack_level < tool->Results.Size)
14406 if (tool->
Results[stack_level].QuerySuccess || tool->
Results[stack_level].QueryFrameCount > 2)
14411 if (stack_level == -1)
14413 if (stack_level >= 0 && stack_level < tool->Results.Size)
14416 tool->
Results[stack_level].QueryFrameCount++;
14433 for (
int n = 0; n < window->
IDStack.
Size + 1; n++)
14434 tool->
Results[n].ID = (n < window->IDStack.Size) ? window->
IDStack[n] : id;
14451 ImFormatString(info->
Desc,
IM_ARRAYSIZE(info->
Desc),
"%.*s", data_id_end ? (
int)((
const char*)data_id_end - (
const char*)data_id) : (int)strlen((
const char*)data_id), (
const char*)data_id);
14457 if (info->
Desc[0] != 0)
14468static int StackToolFormatLevelInfo(
ImGuiStackTool* tool,
int n,
bool format_for_ui,
char* buf,
size_t buf_size)
14473 return ImFormatString(buf, buf_size, format_for_ui ?
"\"%s\" [window]" :
"%s", window->Name);
14478#ifdef IMGUI_ENABLE_TEST_ENGINE
14479 if (
const char* label = ImGuiTestEngine_FindItemDebugLabel(
GImGui, info->
ID))
14480 return ImFormatString(buf, buf_size, format_for_ui ?
"??? \"%s\"" :
"%s", label);
14501#ifdef IMGUI_ENABLE_TEST_ENGINE
14502 Text(
"HoveredId: 0x%08X (\"%s\"), ActiveId: 0x%08X (\"%s\")", hovered_id, hovered_id ? ImGuiTestEngine_FindItemDebugLabel(&g, hovered_id) :
"", active_id, active_id ? ImGuiTestEngine_FindItemDebugLabel(&g, active_id) :
"");
14504 Text(
"HoveredId: 0x%08X, ActiveId: 0x%08X", hovered_id, active_id);
14507 MetricsHelpMarker(
"Hover an item with the mouse to display elements of the ID Stack leading to the item's final ID.\nEach level of the stack correspond to a PushID() call.\nAll levels of the stack are hashed together to make the final ID of a widget (ID displayed at the bottom level of the stack).\nRead FAQ entry about the ID stack for details.");
14513 TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f &&
ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ?
ImVec4(1.f, 1.f, 0.3f, 1.f) :
ImVec4(),
"*COPIED*");
14519 for (
int stack_n = 0; stack_n < tool->
Results.
Size && p + 3 < p_end; stack_n++)
14522 char level_desc[256];
14523 StackToolFormatLevelInfo(tool, stack_n,
false, level_desc,
IM_ARRAYSIZE(level_desc));
14524 for (
int n = 0; level_desc[n] && p + 2 < p_end; n++)
14526 if (level_desc[n] ==
'/')
14528 *p++ = level_desc[n];
14548 Text(
"0x%08X", (n > 0) ? tool->
Results[n - 1].ID : 0);
14553 Text(
"0x%08X", info->
ID);
14582void ImGui::UpdateDebugToolItemPicker() {}
14583void ImGui::UpdateDebugToolStackQueries() {}
14591#ifdef IMGUI_INCLUDE_IMGUI_USER_INL
14592#include "imgui_user.inl"
const char * ImStreolRange(const char *str, const char *str_end)
char * ImStrdupcpy(char *dst, size_t *p_dst_size, const char *src)
#define va_copy(dest, src)
char * ImStrdup(const char *str)
int ImFormatStringV(char *buf, size_t buf_size, const char *fmt, va_list args)
ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, const ImVec2 &p, float tess_tol)
const ImWchar * ImStrbolW(const ImWchar *buf_mid_line, const ImWchar *buf_begin)
ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
void ImTriangleBarycentricCoords(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p, float &out_u, float &out_v, float &out_w)
void ImFormatStringToTempBuffer(const char **out_buf, const char **out_buf_end, const char *fmt,...)
int ImTextStrToUtf8(char *out_buf, int out_buf_size, const ImWchar *in_text, const ImWchar *in_text_end)
int ImStrnicmp(const char *str1, const char *str2, size_t count)
int ImStrlenW(const ImWchar *str)
const char * ImStrchrRange(const char *str, const char *str_end, char c)
int ImFormatString(char *buf, size_t buf_size, const char *fmt,...)
ImVec2 ImLineClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &p)
void ImStrTrimBlanks(char *buf)
void ImFormatStringToTempBufferV(const char **out_buf, const char **out_buf_end, const char *fmt, va_list args)
#define MAP_LEGACY_NAV_INPUT_TO_KEY2(_KEY, _NAV1, _NAV2)
IM_MSVC_RUNTIME_CHECKS_RESTORE IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b)
const char * ImStrSkipBlank(const char *str)
const char * ImTextCharToUtf8(char out_buf[5], unsigned int c)
bool ImTriangleContainsPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
ImU64 ImFileWrite(const void *data, ImU64 sz, ImU64 count, ImFileHandle f)
#define IMGUI_DEBUG_NAV_SCORING
int ImTextCountUtf8BytesFromStr(const ImWchar *in_text, const ImWchar *in_text_end)
ImU64 ImFileRead(void *data, ImU64 sz, ImU64 count, ImFileHandle f)
ImGuiID ImHashStr(const char *data_p, size_t data_size, ImGuiID seed)
#define MAP_LEGACY_NAV_INPUT_TO_KEY1(_KEY, _NAV1)
IM_MSVC_RUNTIME_CHECKS_OFF int ImTextCharFromUtf8(unsigned int *out_char, const char *in_text, const char *in_text_end)
int ImTextCountCharsFromUtf8(const char *in_text, const char *in_text_end)
bool ImFileClose(ImFileHandle f)
void * ImFileLoadToMemory(const char *filename, const char *mode, size_t *out_file_size, int padding_bytes)
const char * ImStristr(const char *haystack, const char *haystack_end, const char *needle, const char *needle_end)
ImVec2 ImBezierCubicClosestPoint(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, const ImVec2 &p, int num_segments)
ImGuiID ImHashData(const void *data_p, size_t data_size, ImGuiID seed)
ImU64 ImFileGetSize(ImFileHandle f)
int ImStricmp(const char *str1, const char *str2)
int ImTextCountUtf8BytesFromChar(const char *in_text, const char *in_text_end)
ImFileHandle ImFileOpen(const char *filename, const char *mode)
int ImTextStrFromUtf8(ImWchar *buf, int buf_size, const char *in_text, const char *in_text_end, const char **in_text_remaining)
void ImStrncpy(char *dst, const char *src, size_t count)
ImVec2 ImTriangleClosestPoint(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c, const ImVec2 &p)
@ ImGuiFocusedFlags_AnyWindow
@ ImGuiFocusedFlags_NoPopupHierarchy
@ ImGuiDragDropFlags_AcceptBeforeDelivery
@ ImGuiDragDropFlags_SourceNoPreviewTooltip
@ ImGuiDragDropFlags_SourceAllowNullID
@ ImGuiDragDropFlags_None
@ ImGuiDragDropFlags_SourceExtern
@ ImGuiDragDropFlags_AcceptNoDrawDefaultRect
@ ImGuiDragDropFlags_SourceNoDisableHover
@ ImGuiDragDropFlags_SourceAutoExpirePayload
@ ImGuiDragDropFlags_AcceptNoPreviewTooltip
#define IM_COL32(R, G, B, A)
@ ImGuiHoveredFlags_DelayShort
@ ImGuiHoveredFlags_AllowWhenBlockedByActiveItem
@ ImGuiHoveredFlags_AllowWhenBlockedByPopup
@ ImGuiHoveredFlags_NoNavOverride
@ ImGuiHoveredFlags_NoPopupHierarchy
@ ImGuiHoveredFlags_NoSharedDelay
@ ImGuiHoveredFlags_ChildWindows
@ ImGuiHoveredFlags_RootWindow
@ ImGuiHoveredFlags_AnyWindow
@ ImGuiHoveredFlags_AllowWhenOverlapped
@ ImGuiHoveredFlags_AllowWhenDisabled
@ ImGuiHoveredFlags_DelayNormal
@ ImGuiConfigFlags_NoMouse
@ ImGuiConfigFlags_NavEnableSetMousePos
@ ImGuiConfigFlags_NavEnableGamepad
@ ImGuiConfigFlags_NavEnableKeyboard
@ ImGuiConfigFlags_NavNoCaptureKeyboard
void *(* ImGuiMemAllocFunc)(size_t sz, void *user_data)
void(* ImGuiSizeCallback)(ImGuiSizeCallbackData *data)
@ ImDrawListFlags_AntiAliasedLinesUseTex
@ ImDrawListFlags_AntiAliasedFill
@ ImDrawListFlags_AntiAliasedLines
@ ImDrawListFlags_AllowVtxOffset
@ ImGuiBackendFlags_HasGamepad
@ ImGuiBackendFlags_HasMouseCursors
@ ImGuiBackendFlags_HasSetMousePos
@ ImGuiBackendFlags_RendererHasVtxOffset
@ ImGuiMouseCursor_ResizeNWSE
@ ImGuiMouseCursor_ResizeEW
@ ImGuiMouseCursor_ResizeNS
@ ImGuiMouseCursor_ResizeNESW
#define IM_OFFSETOF(_TYPE, _MEMBER)
#define IM_PLACEMENT_NEW(_PTR)
@ ImGuiTableColumnFlags_WidthFixed
@ ImGuiTableColumnFlags_WidthStretch
@ ImGuiPopupFlags_MouseButtonMask_
@ ImGuiPopupFlags_AnyPopupLevel
@ ImGuiPopupFlags_NoOpenOverExistingPopup
@ ImGuiPopupFlags_AnyPopupId
@ ImGuiPopupFlags_NoOpenOverItems
@ ImGuiStyleVar_ChildRounding
@ ImGuiStyleVar_WindowPadding
@ ImGuiStyleVar_ChildBorderSize
@ ImGuiInputTextFlags_ReadOnly
@ ImGuiTableBgTarget_CellBg
#define IM_MSVC_RUNTIME_CHECKS_OFF
@ ImFontAtlasFlags_NoBakedLines
@ ImGuiCol_FrameBgHovered
@ ImGuiCol_TitleBgCollapsed
@ ImGuiCol_PlotHistogramHovered
@ ImGuiCol_TextSelectedBg
@ ImGuiCol_ModalWindowDimBg
@ ImGuiCol_DragDropTarget
@ ImGuiCol_TabUnfocusedActive
@ ImGuiCol_SeparatorActive
@ ImGuiCol_ScrollbarGrabActive
@ ImGuiCol_ResizeGripActive
@ ImGuiCol_TableBorderLight
@ ImGuiCol_ScrollbarGrabHovered
@ ImGuiCol_ResizeGripHovered
@ ImGuiCol_NavWindowingHighlight
@ ImGuiCol_TableBorderStrong
@ ImGuiCol_SliderGrabActive
@ ImGuiCol_SeparatorHovered
@ ImGuiCol_NavWindowingDimBg
@ ImGuiCol_PlotLinesHovered
#define IM_UNICODE_CODEPOINT_INVALID
@ ImGuiKey_GamepadFaceRight
@ ImGuiKey_GamepadLStickDown
@ ImGuiKey_NamedKey_BEGIN
@ ImGuiKey_GamepadDpadDown
@ ImGuiKey_KeysData_OFFSET
@ ImGuiKey_GamepadLStickUp
@ ImGuiKey_GamepadFaceDown
@ ImGuiKey_GamepadLStickLeft
@ ImGuiKey_GamepadDpadRight
@ ImGuiKey_GamepadDpadLeft
@ ImGuiKey_NamedKey_COUNT
@ ImGuiKey_GamepadFaceLeft
@ ImGuiKey_GamepadLStickRight
@ ImGuiTreeNodeFlags_Selected
@ ImGuiTreeNodeFlags_None
@ ImGuiNavInput_FocusPrev
@ ImGuiNavInput_LStickRight
@ ImGuiNavInput_TweakFast
@ ImGuiNavInput_DpadRight
@ ImGuiNavInput_FocusNext
@ ImGuiNavInput_LStickLeft
@ ImGuiNavInput_LStickDown
@ ImGuiNavInput_TweakSlow
#define IM_MSVC_RUNTIME_CHECKS_RESTORE
@ ImGuiViewportFlags_OwnedByApp
@ ImGuiViewportFlags_IsPlatformWindow
@ ImGuiViewportFlags_IsPlatformMonitor
@ ImGuiWindowFlags_NoInputs
@ ImGuiWindowFlags_NoBackground
@ ImGuiWindowFlags_NoNavInputs
@ ImGuiWindowFlags_AlwaysUseWindowPadding
@ ImGuiWindowFlags_AlwaysAutoResize
@ ImGuiWindowFlags_MenuBar
@ ImGuiWindowFlags_HorizontalScrollbar
@ ImGuiWindowFlags_Tooltip
@ ImGuiWindowFlags_NoTitleBar
@ ImGuiWindowFlags_NoNavFocus
@ ImGuiWindowFlags_AlwaysVerticalScrollbar
@ ImGuiWindowFlags_NoFocusOnAppearing
@ ImGuiWindowFlags_NoCollapse
@ ImGuiWindowFlags_NoScrollWithMouse
@ ImGuiWindowFlags_NoMouseInputs
@ ImGuiWindowFlags_UnsavedDocument
@ ImGuiWindowFlags_NoSavedSettings
@ ImGuiWindowFlags_NoBringToFrontOnFocus
@ ImGuiWindowFlags_ChildMenu
@ ImGuiWindowFlags_AlwaysHorizontalScrollbar
@ ImGuiWindowFlags_NavFlattened
@ ImGuiWindowFlags_NoMove
@ ImGuiWindowFlags_ChildWindow
@ ImGuiWindowFlags_NoResize
@ ImGuiWindowFlags_NoScrollbar
void(* ImGuiMemFreeFunc)(void *ptr, void *user_data)
@ ImGuiTableFlags_Borders
@ ImGuiTableFlags_SizingFixedFit
#define IM_ARRAYSIZE(_ARR)
#define IM_UNICODE_CODEPOINT_MAX
@ ImDrawFlags_RoundCornersBottom
@ ImDrawFlags_RoundCornersTop
ImVec2 ImBezierCubicCalc(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, float t)
@ ImGuiContextHookType_PendingRemoval_
@ ImGuiContextHookType_RenderPost
@ ImGuiContextHookType_NewFramePost
@ ImGuiContextHookType_RenderPre
@ ImGuiContextHookType_EndFramePre
@ ImGuiContextHookType_NewFramePre
@ ImGuiContextHookType_EndFramePost
@ ImGuiContextHookType_Shutdown
#define IM_F32_TO_INT8_SAT(_VAL)
#define IMGUI_DEBUG_PRINTF(_FMT,...)
@ ImGuiScrollFlags_KeepVisibleEdgeY
@ ImGuiScrollFlags_MaskX_
@ ImGuiScrollFlags_NoScrollParent
@ ImGuiScrollFlags_AlwaysCenterX
@ ImGuiScrollFlags_KeepVisibleCenterX
@ ImGuiScrollFlags_AlwaysCenterY
@ ImGuiScrollFlags_MaskY_
@ ImGuiScrollFlags_KeepVisibleEdgeX
@ ImGuiScrollFlags_KeepVisibleCenterY
#define ImGuiKey_NavGamepadTweakFast
#define ImGuiKey_Gamepad_END
@ ImGuiLocKey_WindowingMainMenuBar
@ ImGuiLocKey_TableSizeAllDefault
@ ImGuiLocKey_TableResetOrder
@ ImGuiLocKey_WindowingUntitled
@ ImGuiLocKey_WindowingPopup
@ ImGuiLocKey_TableSizeAllFit
@ ImGuiLocKey_TableSizeOne
@ ImGuiButtonFlags_FlattenChildren
@ ImGuiButtonFlags_NoNavFocus
#define IM_ASSERT_USER_ERROR(_EXP, _MSG)
@ ImGuiNavHighlightFlags_NoRounding
@ ImGuiNavHighlightFlags_TypeThin
@ ImGuiNavHighlightFlags_AlwaysDraw
@ ImGuiNavHighlightFlags_TypeDefault
@ ImGuiDebugLogFlags_EventClipper
@ ImGuiDebugLogFlags_OutputToTTY
@ ImGuiDebugLogFlags_EventFocus
@ ImGuiDebugLogFlags_EventActiveId
@ ImGuiDebugLogFlags_EventNav
@ ImGuiDebugLogFlags_EventIO
@ ImGuiDebugLogFlags_EventMask_
@ ImGuiDebugLogFlags_EventPopup
#define ImGuiKey_NavGamepadCancel
#define IMGUI_DEBUG_LOG_CLIPPER(...)
@ ImGuiItemFlags_Disabled
@ ImGuiItemFlags_NoTabStop
@ ImGuiItemFlags_NoNavDefaultFocus
@ ImGuiItemFlags_ButtonRepeat
@ ImGuiItemFlags_Inputable
@ ImGuiItemFlags_NoWindowHoverableCheck
IMGUI_API char * ImStrdup(const char *str)
#define ImGuiKey_NavGamepadActivate
#define IMGUI_DEBUG_LOG_ACTIVEID(...)
@ ImGuiTooltipFlags_OverridePreviousTooltip
@ ImGuiItemStatusFlags_ToggledSelection
@ ImGuiItemStatusFlags_HasDisplayRect
@ ImGuiItemStatusFlags_HoveredRect
@ ImGuiItemStatusFlags_Deactivated
@ ImGuiItemStatusFlags_Edited
@ ImGuiItemStatusFlags_HasDeactivated
@ ImGuiItemStatusFlags_HoveredWindow
@ ImGuiItemStatusFlags_None
@ ImGuiItemStatusFlags_Visible
@ ImGuiItemStatusFlags_ToggledOpen
#define ImGuiKeyOwner_Any
#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID, _LABEL, _FLAGS)
IMGUI_API ImGuiID ImHashStr(const char *data, size_t data_size=0, ImGuiID seed=0)
#define ImGuiKey_NavGamepadMenu
@ ImGuiInputFlags_RepeatRateMask_
@ ImGuiInputFlags_CondActive
@ ImGuiInputFlags_RepeatRateNavTweak
@ ImGuiInputFlags_RouteMask_
@ ImGuiInputFlags_CondDefault_
@ ImGuiInputFlags_SupportedByShortcut
@ ImGuiInputFlags_SupportedBySetItemKeyOwner
@ ImGuiInputFlags_RepeatRateDefault
@ ImGuiInputFlags_LockUntilRelease
@ ImGuiInputFlags_RouteGlobal
@ ImGuiInputFlags_RouteGlobalLow
@ ImGuiInputFlags_CondHovered
@ ImGuiInputFlags_LockThisFrame
@ ImGuiInputFlags_RouteFocused
@ ImGuiInputFlags_CondMask_
@ ImGuiInputFlags_SupportedByIsKeyPressed
@ ImGuiInputFlags_RouteGlobalHigh
@ ImGuiInputFlags_RouteAlways
@ ImGuiInputFlags_RouteUnlessBgFocused
@ ImGuiInputFlags_RepeatRateNavMove
@ ImGuiInputFlags_SupportedBySetKeyOwner
#define ImGuiKeyOwner_None
@ ImGuiInputEventType_Focus
@ ImGuiInputEventType_Text
@ ImGuiInputEventType_MouseWheel
@ ImGuiInputEventType_Key
@ ImGuiInputEventType_MousePos
@ ImGuiInputEventType_MouseButton
int ImGuiNavHighlightFlags
#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB, _ID)
@ ImGuiInputSource_Gamepad
@ ImGuiInputSource_Keyboard
#define ImGuiKey_NavGamepadInput
#define ImGuiKey_LegacyNativeKey_END
@ ImGuiPopupPositionPolicy_ComboBox
@ ImGuiPopupPositionPolicy_Tooltip
@ ImGuiPopupPositionPolicy_Default
#define IMGUI_DEBUG_LOG_FOCUS(...)
ImS16 ImGuiKeyRoutingIndex
#define ImGuiKey_Keyboard_END
#define IMGUI_DEBUG_LOG_NAV(...)
@ ImGuiNextItemDataFlags_None
@ ImGuiNextItemDataFlags_HasWidth
#define IM_STATIC_ASSERT(_COND)
#define ImGuiKey_LegacyNativeKey_BEGIN
@ ImGuiNextWindowDataFlags_HasSizeConstraint
@ ImGuiNextWindowDataFlags_HasSize
@ ImGuiNextWindowDataFlags_HasFocus
@ ImGuiNextWindowDataFlags_HasBgAlpha
@ ImGuiNextWindowDataFlags_HasContentSize
@ ImGuiNextWindowDataFlags_HasScroll
@ ImGuiNextWindowDataFlags_HasCollapsed
@ ImGuiNextWindowDataFlags_HasPos
@ ImGuiLayoutType_Vertical
@ ImGuiLayoutType_Horizontal
#define IMGUI_DEBUG_LOG_POPUP(...)
@ ImGuiActivateFlags_PreferInput
@ ImGuiActivateFlags_TryToPreserveState
@ ImGuiActivateFlags_None
@ ImGuiActivateFlags_PreferTweak
@ ImGuiNavMoveFlags_Forwarded
@ ImGuiNavMoveFlags_WrapY
@ ImGuiNavMoveFlags_Tabbing
@ ImGuiNavMoveFlags_AlsoScoreVisibleSet
@ ImGuiNavMoveFlags_DontSetNavHighlight
@ ImGuiNavMoveFlags_AllowCurrentNavId
@ ImGuiNavMoveFlags_DebugNoResult
@ ImGuiNavMoveFlags_WrapX
@ ImGuiNavMoveFlags_LoopY
@ ImGuiNavMoveFlags_ScrollToEdgeY
@ ImGuiNavMoveFlags_LoopX
@ ImGuiNavMoveFlags_FocusApi
@ ImGuiNavMoveFlags_Activate
#define ImGuiKey_NavGamepadTweakSlow
float ImTriangleArea(const ImVec2 &a, const ImVec2 &b, const ImVec2 &c)
#define IM_MSVC_WARNING_SUPPRESS(XXXX)
#define IMGUI_DEBUG_LOG_IO(...)
#define ImGuiKey_Gamepad_BEGIN
void(* ImGuiErrorLogCallback)(void *user_data, const char *fmt,...)
#define ImGuiKey_Keyboard_BEGIN
IMGUI_API ImGuiID ImHashData(const void *data, size_t data_size, ImGuiID seed=0)
IMGUI_API void SetCursorPosY(float local_y)
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow *ref_window, bool restore_focus_to_window_under_popup)
IMGUI_API int GetFrameCount()
IMGUI_API float GetCursorPosX()
IMGUI_API void RenderTextEllipsis(ImDrawList *draw_list, const ImVec2 &pos_min, const ImVec2 &pos_max, float clip_max_x, float ellipsis_max_x, const char *text, const char *text_end, const ImVec2 *text_size_if_known)
IMGUI_API void EndDragDropSource()
IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key)
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API bool BeginTable(const char *str_id, int column, ImGuiTableFlags flags=0, const ImVec2 &outer_size=ImVec2(0.0f, 0.0f), float inner_width=0.0f)
IMGUI_API bool IsAnyItemHovered()
ImGuiWindow * GetCurrentWindowRead()
const char * LocalizeGetMsg(ImGuiLocKey key)
IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2 &size, ImGuiWindowFlags flags=0)
IMGUI_API void EndGroup()
IMGUI_API bool BeginTooltip()
IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags status_flags, const ImRect &item_rect)
ImRect WindowRectAbsToRel(ImGuiWindow *window, const ImRect &r)
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
IMGUI_API void SetScrollX(float scroll_x)
IMGUI_API void PopTextWrapPos()
IMGUI_API ImVec2 GetContentRegionMax()
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup)
IMGUI_API void TableHeadersRow()
IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow *window, const ImRect &rect, ImGuiScrollFlags flags=0)
IMGUI_API bool IsAnyMouseDown()
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
IMGUI_API bool IsPopupOpen(const char *str_id, ImGuiPopupFlags flags=0)
IMGUI_API bool IsItemVisible()
IMGUI_API void RemoveSettingsHandler(const char *type_name)
IMGUI_API void PopButtonRepeat()
IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold=-1.0f)
IMGUI_API void DebugNodeWindowsListByBeginStackParent(ImGuiWindow **windows, int windows_size, ImGuiWindow *parent_in_begin_stack)
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect &rect_rel)
IMGUI_API ImGuiID GetItemID()
IMGUI_API void TextV(const char *fmt, va_list args) IM_FMTLIST(1)
ImRect WindowRectRelToAbs(ImGuiWindow *window, const ImRect &r)
IMGUI_API bool BeginPopup(const char *str_id, ImGuiWindowFlags flags=0)
IMGUI_API void ShowFontAtlas(ImFontAtlas *atlas)
IMGUI_API const char * GetClipboardText()
IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button=0)
IMGUI_API void PushClipRect(const ImVec2 &clip_rect_min, const ImVec2 &clip_rect_max, bool intersect_with_current_clip_rect)
IMGUI_API void SetWindowFontScale(float scale)
IMGUI_API void SetNextItemWidth(float item_width)
IMGUI_API void DebugRenderKeyboardPreview(ImDrawList *draw_list)
IMGUI_API void PopStyleVar(int count=1)
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2 &size_min, const ImVec2 &size_max, ImGuiSizeCallback custom_callback=NULL, void *custom_callback_data=NULL)
IMGUI_API const ImGuiPayload * GetDragDropPayload()
IMGUI_API void ClearActiveID()
IMGUI_API ImGuiWindowSettings * FindWindowSettingsByID(ImGuiID id)
IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags)
IMGUI_API void Separator()
IMGUI_API void Initialize()
IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float *repeat_delay, float *repeat_rate)
IMGUI_API const char * GetKeyName(ImGuiKey key)
bool IsNamedKey(ImGuiKey key)
IMGUI_API ImGuiID AddContextHook(ImGuiContext *context, const ImGuiContextHook *hook)
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow *window)
IMGUI_API bool TreeNodeEx(const char *label, ImGuiTreeNodeFlags flags=0)
IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow *window, int n)
IMGUI_API bool IsMousePosValid(const ImVec2 *mouse_pos=NULL)
IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button=0, float lock_threshold=-1.0f)
IMGUI_API void EndFrame()
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList *out_draw_list, const ImDrawList *draw_list, const ImDrawCmd *draw_cmd, bool show_mesh, bool show_aabb)
ImGuiKey MouseButtonToKey(ImGuiMouseButton button)
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags)
IMGUI_API const char * GetStyleColorName(ImGuiCol idx)
IMGUI_API void MemFree(void *ptr)
IMGUI_API void StyleColorsDark(ImGuiStyle *dst=NULL)
IMGUI_API const char * SaveIniSettingsToMemory(size_t *out_ini_size=NULL)
IMGUI_API void PushID(const char *str_id)
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow *window)
IMGUI_API void SetCurrentContext(ImGuiContext *ctx)
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
IMGUI_API void GetKeyChordName(ImGuiKeyChord key_chord, char *out_buf, int out_buf_size)
IMGUI_API ImDrawListSharedData * GetDrawListSharedData()
IMGUI_API bool IsWindowCollapsed()
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button)
IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id)
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat=false)
IMGUI_API bool IsItemActive()
IMGUI_API const ImGuiDataVarInfo * GetStyleVarInfo(ImGuiStyleVar idx)
IMGUI_API void LogFinish()
IMGUI_API ImGuiWindowSettings * CreateNewWindowSettings(const char *name)
IMGUI_API bool BeginListBox(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API bool IsItemToggledOpen()
IMGUI_API ImVec2 GetCursorPos()
IMGUI_API ImVec2 GetFontTexUvWhitePixel()
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow *window)
IMGUI_API void SetTooltip(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API ImGuiIO & GetIO()
IMGUI_API void SetScrollHereX(float center_x_ratio=0.5f)
IMGUI_API void DebugTextEncoding(const char *text)
IMGUI_API void SetItemAllowOverlap()
IMGUI_API ImVec2 GetItemRectSize()
IMGUI_API ImGuiID GetID(const char *str_id)
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow *window)
IMGUI_API void SetNextWindowScroll(const ImVec2 &scroll)
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
IMGUI_API void SetItemDefaultFocus()
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void OpenPopupOnItemClick(const char *str_id=NULL, ImGuiPopupFlags popup_flags=1)
IMGUI_API void SetTooltipV(const char *fmt, va_list args) IM_FMTLIST(1)
IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key)
IMGUI_API ImGuiMouseCursor GetMouseCursor()
IMGUI_API void UpdateMouseMovingWindowNewFrame()
IMGUI_API float GetScrollY()
IMGUI_API ImVec2 GetItemRectMax()
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond=0)
IMGUI_API double GetTime()
IMGUI_API bool NavMoveRequestButNoResultYet()
IMGUI_API ImVec2 GetContentRegionAvail()
IMGUI_API ImVec2 GetWindowPos()
IMGUI_API void SetScrollY(float scroll_y)
IMGUI_API void BeginGroup()
IMGUI_API void NavMoveRequestCancel()
IMGUI_API ImFont * GetFont()
IMGUI_API bool BeginPopupContextItem(const char *str_id=NULL, ImGuiPopupFlags popup_flags=1)
IMGUI_API ImGuiKeyRoutingData * GetShortcutRoutingData(ImGuiKeyChord key_chord)
IMGUI_API float GetWindowHeight()
IMGUI_API bool SetDragDropPayload(const char *type, const void *data, size_t sz, ImGuiCond cond=0)
IMGUI_API void RenderBullet(ImDrawList *draw_list, ImVec2 pos, ImU32 col)
IMGUI_API float GetWindowWidth()
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings *settings)
IMGUI_API bool IsKeyPressed(ImGuiKey key, bool repeat=true)
IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate)
IMGUI_API bool ItemHoverable(const ImRect &bb, ImGuiID id)
IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow *window, ImGuiWindow *potential_parent)
IMGUI_API void TableSettingsAddSettingsHandler()
IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond=0)
IMGUI_API void TableSetupColumn(const char *label, ImGuiTableColumnFlags flags=0, float init_width_or_weight=0.0f, ImGuiID user_id=0)
IMGUI_API void PushItemWidth(float item_width)
IMGUI_API void LoadIniSettingsFromDisk(const char *ini_filename)
IMGUI_API void LogToBuffer(int auto_open_depth=-1)
IMGUI_API bool TreeNode(const char *label)
IMGUI_API void TableGcCompactSettings()
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2 &pos)
IMGUI_API void SetCurrentFont(ImFont *font)
IMGUI_API void DebugNodeDrawList(ImGuiWindow *window, const ImDrawList *draw_list, const char *label)
IMGUI_API ImGuiContext * CreateContext(ImFontAtlas *shared_font_atlas=NULL)
IMGUI_API void NavInitRequestApplyResult()
IMGUI_API void SetCursorPos(const ImVec2 &local_pos)
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0)
IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void *data_id, const void *data_id_end)
IMGUI_API void RenderDragDropTargetRect(const ImRect &bb)
IMGUI_API void Scrollbar(ImGuiAxis axis)
IMGUI_API bool IsItemActivated()
IMGUI_API bool IsRectVisible(const ImVec2 &size)
IMGUI_API bool Checkbox(const char *label, bool *v)
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *format="%d", ImGuiSliderFlags flags=0)
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API void ShowStackToolWindow(bool *p_open=NULL)
IMGUI_API const char * TabBarGetTabName(ImGuiTabBar *tab_bar, ImGuiTabItem *tab)
IMGUI_API bool SmallButton(const char *label)
IMGUI_API void SetStateStorage(ImGuiStorage *storage)
IMGUI_API float GetTreeNodeToLabelSpacing()
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags flags=0)
IMGUI_API bool ItemAdd(const ImRect &bb, ImGuiID id, const ImRect *nav_bb=NULL, ImGuiItemFlags extra_flags=0)
IMGUI_API const ImGuiPayload * AcceptDragDropPayload(const char *type, ImGuiDragDropFlags flags=0)
IMGUI_API void SetActiveIdUsingAllKeyboardKeys()
IMGUI_API void DebugLocateItem(ImGuiID target_id)
IMGUI_API void CallContextHooks(ImGuiContext *context, ImGuiContextHookType type)
IMGUI_API void PushButtonRepeat(bool repeat)
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border=true, float rounding=0.0f)
IMGUI_API void ClosePopupsExceptModals()
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
IMGUI_API bool BeginChildEx(const char *name, ImGuiID id, const ImVec2 &size_arg, bool border, ImGuiWindowFlags flags)
IMGUI_API const char * GetVersion()
IMGUI_API bool IsItemEdited()
IMGUI_API void SetWindowSize(const ImVec2 &size, ImGuiCond cond=0)
IMGUI_API bool ButtonBehavior(const ImRect &bb, ImGuiID id, bool *out_hovered, bool *out_held, ImGuiButtonFlags flags=0)
IMGUI_API ImVec2 GetItemRectMin()
IMGUI_API void PopFocusScope()
IMGUI_API float CalcWrapWidthForPos(const ImVec2 &pos, float wrap_pos_x)
IMGUI_API void LogSetNextTextDecoration(const char *prefix, const char *suffix)
IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio=0.5f)
IMGUI_API bool IsDragDropPayloadBeingAccepted()
IMGUI_API bool BeginPopupContextVoid(const char *str_id=NULL, ImGuiPopupFlags popup_flags=1)
IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry *entries, int count)
IMGUI_API void DebugNodeColumns(ImGuiOldColumns *columns)
IMGUI_API void EndListBox()
IMGUI_API ImGuiWindow * GetTopMostPopupModal()
IMGUI_API void TableEndRow(ImGuiTable *table)
IMGUI_API void Indent(float indent_w=0.0f)
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow *window)
IMGUI_API void PushMultiItemsWidths(int components, float width_full)
IMGUI_API void UpdateMouseMovingWindowEndFrame()
IMGUI_API bool IsWindowChildOf(ImGuiWindow *window, ImGuiWindow *potential_parent, bool popup_hierarchy)
IMGUI_API float GetScrollX()
IMGUI_API void RenderTextClippedEx(ImDrawList *draw_list, const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &align=ImVec2(0, 0), const ImRect *clip_rect=NULL)
IMGUI_API void LogToClipboard(int auto_open_depth=-1)
IMGUI_API ImDrawList * GetForegroundDrawList()
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow *window)
IMGUI_API void PushTextWrapPos(float wrap_local_pos_x=0.0f)
IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in)
IMGUI_API const char * FindRenderedTextEnd(const char *text, const char *text_end=NULL)
IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id)
IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button=0)
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col)
IMGUI_API ImVec2 GetWindowContentRegionMin()
IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id=0, ImGuiInputFlags flags=0)
IMGUI_API void LogRenderedText(const ImVec2 *ref_pos, const char *text, const char *text_end=NULL)
bool IsNamedKeyOrModKey(ImGuiKey key)
IMGUI_API void LogButtons()
IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down)
IMGUI_API ImGuiViewport * GetMainViewport()
IMGUI_API bool IsClippedEx(const ImRect &bb, ImGuiID id)
IMGUI_API void SetAllocatorFunctions(ImGuiMemAllocFunc alloc_func, ImGuiMemFreeFunc free_func, void *user_data=NULL)
IMGUI_API void SetNextWindowBgAlpha(float alpha)
IMGUI_API void UpdateHoveredWindowAndCaptureFlags()
IMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns *columns, float offset_norm)
IMGUI_API bool IsKeyDown(ImGuiKey key)
IMGUI_API ImGuiWindow * FindWindowByID(ImGuiID id)
IMGUI_API void MarkItemEdited(ImGuiID id)
ImFont * GetDefaultFont()
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow *window)
IMGUI_API void SetWindowHitTestHole(ImGuiWindow *window, const ImVec2 &pos, const ImVec2 &size)
IMGUI_API void ClearIniSettings()
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
IMGUI_API void GetAllocatorFunctions(ImGuiMemAllocFunc *p_alloc_func, ImGuiMemFreeFunc *p_free_func, void **p_user_data)
IMGUI_API void KeepAliveID(ImGuiID id)
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow *window, ImGuiWindowFlags flags, ImGuiWindow *parent_window)
IMGUI_API void EndTabBar()
IMGUI_API float GetCursorPosY()
bool IsLegacyKey(ImGuiKey key)
IMGUI_API bool IsItemToggledSelection()
IMGUI_API void SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags=0)
IMGUI_API void NavMoveRequestApplyResult()
IMGUI_API bool IsAnyItemFocused()
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow *window)
IMGUI_API void Dummy(const ImVec2 &size)
IMGUI_API bool IsItemDeactivatedAfterEdit()
IMGUI_API void DebugNodeWindowsList(ImVector< ImGuiWindow * > *windows, const char *label)
IMGUI_API void BringWindowToDisplayBehind(ImGuiWindow *window, ImGuiWindow *above_window)
IMGUI_API void LogBegin(ImGuiLogType type, int auto_open_depth)
IMGUI_API float GetFrameHeightWithSpacing()
IMGUI_API void DebugNodeStorage(ImGuiStorage *storage, const char *label)
IMGUI_API void LoadIniSettingsFromMemory(const char *ini_data, size_t ini_size=0)
IMGUI_API ImVec2 GetCursorStartPos()
IMGUI_API void LogToFile(int auto_open_depth=-1, const char *filename=NULL)
bool IsActiveIdUsingNavDir(ImGuiDir dir)
IMGUI_API bool BeginDragDropTargetCustom(const ImRect &bb, ImGuiID id)
IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void *user_data=NULL)
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow *window, ImGuiNavMoveFlags move_flags)
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
IMGUI_API ImVec2 GetWindowContentRegionMax()
IMGUI_API void PopStyleColor(int count=1)
IMGUI_API void ScrollToRect(ImGuiWindow *window, const ImRect &rect, ImGuiScrollFlags flags=0)
IMGUI_API void LogTextV(const char *fmt, va_list args) IM_FMTLIST(1)
IMGUI_API void RenderText(ImVec2 pos, const char *text, const char *text_end=NULL, bool hide_text_after_hash=true)
IMGUI_API bool IsWindowAppearing()
IMGUI_API void EndTable()
IMGUI_API void OpenPopup(const char *str_id, ImGuiPopupFlags popup_flags=0)
IMGUI_API void EndDisabled()
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool DebugCheckVersionAndDataLayout(const char *version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx)
IMGUI_API ImDrawList * GetWindowDrawList()
IMGUI_API float GetTextLineHeightWithSpacing()
IMGUI_API bool Combo(const char *label, int *current_item, const char *const items[], int items_count, int popup_max_height_in_items=-1)
IMGUI_API ImGuiStorage * GetStateStorage()
IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow *window)
IMGUI_API ImGuiWindowSettings * FindWindowSettingsByWindow(ImGuiWindow *window)
IMGUI_API void SetNavWindow(ImGuiWindow *window)
IMGUI_API void SetClipboardText(const char *text)
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char *text, const char *text_end, float wrap_width)
IMGUI_API void LogText(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void DebugNodeViewport(ImGuiViewportP *viewport)
IMGUI_API void EndPopup()
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API ImGuiWindow * GetTopMostAndVisiblePopupModal()
IMGUI_API void PopItemFlag()
IMGUI_API void TextDisabled(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API ImVec2 GetWindowSize()
IMGUI_API void DebugLog(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void SetWindowPos(const ImVec2 &pos, ImGuiCond cond=0)
IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags)
IMGUI_API void GcCompactTransientMiscBuffers()
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", ImGuiSliderFlags flags=0)
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
IMGUI_API float GetTextLineHeight()
IMGUI_API void RemoveContextHook(ImGuiContext *context, ImGuiID hook_to_remove)
IMGUI_API void SetNextWindowContentSize(const ImVec2 &size)
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0)
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float &out_h, float &out_s, float &out_v)
IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void *user_data=NULL)
ImGuiTableInstanceData * TableGetInstanceData(ImGuiTable *table, int instance_no)
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs)
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiCond cond=0)
IMGUI_API float GetScrollMaxY()
IMGUI_API ImDrawList * GetBackgroundDrawList()
IMGUI_API void RenderTextClipped(const ImVec2 &pos_min, const ImVec2 &pos_max, const char *text, const char *text_end, const ImVec2 *text_size_if_known, const ImVec2 &align=ImVec2(0, 0), const ImRect *clip_rect=NULL)
IMGUI_API float CalcItemWidth()
IMGUI_API ImGuiID GetIDWithSeed(const char *str_id_begin, const char *str_id_end, ImGuiID seed)
IMGUI_API void NewFrame()
IMGUI_API bool CheckboxFlags(const char *label, int *flags, int flags_value)
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2 &ref_pos, const ImVec2 &size, ImGuiDir *last_dir, const ImRect &r_outer, const ImRect &r_avoid, ImGuiPopupPositionPolicy policy)
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond=0)
IMGUI_API ImDrawData * GetDrawData()
IMGUI_API void ScrollToItem(ImGuiScrollFlags flags=0)
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState *state)
IMGUI_API void DestroyContext(ImGuiContext *ctx=NULL)
IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate)
IMGUI_API void SetHoveredID(ImGuiID id)
IMGUI_API void PushTabStop(bool tab_stop)
IMGUI_API ImGuiStyle & GetStyle()
void DebugStartItemPicker()
IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow *under_this_window, ImGuiWindow *ignore_window)
IMGUI_API ImGuiWindow * FindWindowByName(const char *name)
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4 &in)
IMGUI_API ImVec2 GetMousePos()
IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags=ImGuiPopupFlags_None)
IMGUI_API void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard)
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup()
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags=0)
IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id=0, ImGuiInputFlags flags=0)
IMGUI_API void SetNextWindowFocus()
IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags=0)
IMGUI_API bool BeginDragDropTarget()
ImGuiWindow * GetCurrentWindow()
IMGUI_API void EndChildFrame()
IMGUI_API void ActivateItem(ImGuiID id)
IMGUI_API float GetFontSize()
IMGUI_API void PushFont(ImFont *font)
IMGUI_API bool IsWindowAbove(ImGuiWindow *potential_above, ImGuiWindow *potential_below)
IMGUI_API void ClearWindowSettings(const char *name)
IMGUI_API void DebugNodeTabBar(ImGuiTabBar *tab_bar, const char *label)
IMGUI_API void SetWindowFocus()
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled)
IMGUI_API void SetScrollHereY(float center_y_ratio=0.5f)
IMGUI_API void EndTooltip()
bool IsAliasKey(ImGuiKey key)
IMGUI_API bool TableNextColumn()
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags=0)
IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type)
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h)
IMGUI_API ImGuiWindow * FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow *window)
bool IsGamepadKey(ImGuiKey key)
IMGUI_API int FindWindowDisplayIndex(ImGuiWindow *window)
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2 &pos)
IMGUI_API bool IsAnyItemActive()
IMGUI_API void PushOverrideID(ImGuiID id)
IMGUI_API void PushFocusScope(ImGuiID id)
IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis)
IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold=-1.0f)
IMGUI_API void LogToTTY(int auto_open_depth=-1)
IMGUI_API void SetScrollFromPosX(float local_x, float center_x_ratio=0.5f)
IMGUI_API void PopItemWidth()
IMGUI_API void SetWindowHiddendAndSkipItemsForCurrentFrame(ImGuiWindow *window)
ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
IMGUI_API void Unindent(float indent_w=0.0f)
IMGUI_API ImGuiID GetHoveredID()
IMGUI_API void DebugNodeFontGlyph(ImFont *font, const ImFontGlyph *glyph)
IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries()
ImGuiKeyOwnerData * GetKeyOwnerData(ImGuiKey key)
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow *window)
IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData *result)
IMGUI_API const ImVec4 & GetStyleColorVec4(ImGuiCol idx)
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings *settings)
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
IMGUI_API ImGuiSettingsHandler * FindSettingsHandler(const char *type_name)
IMGUI_API bool IsItemDeactivated()
IMGUI_API void SetWindowViewport(ImGuiWindow *window, ImGuiViewportP *viewport)
IMGUI_API void ClearDragDrop()
IMGUI_API bool IsDragDropActive()
IMGUI_API ImVec2 GetCursorScreenPos()
IMGUI_API ImVec2 GetContentRegionMaxAbs()
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding=0.0f)
IMGUI_API bool IsItemFocused()
IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler *handler)
IMGUI_API void FocusWindow(ImGuiWindow *window)
IMGUI_API void DebugNodeFont(ImFont *font)
IMGUI_API bool IsMouseHoveringRect(const ImVec2 &r_min, const ImVec2 &r_max, bool clip=true)
ImGuiKeyChord ConvertShortcutMod(ImGuiKeyChord key_chord)
IMGUI_API void AlignTextToFramePadding()
IMGUI_API void NavInitWindow(ImGuiWindow *window, bool force_reinit)
IMGUI_API void CalcListClipping(int items_count, float items_height, int *out_items_display_start, int *out_items_display_end)
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button)
IMGUI_API float GetFrameHeight()
IMGUI_API void SetCursorPosX(float local_x)
IMGUI_API void EndDragDropTarget()
IMGUI_API void SetKeyboardFocusHere(int offset=0)
IMGUI_API void DebugLocateItemResolveWithLastItem()
IMGUI_API void TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n=-1)
IMGUI_API void BeginDisabled(bool disabled=true)
IMGUI_API void DebugNodeTable(ImGuiTable *table)
IMGUI_API void CloseCurrentPopup()
IMGUI_API void Shutdown()
IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow *window, ImGuiDir dir)
IMGUI_API bool IsMouseDown(ImGuiMouseButton button)
IMGUI_API void * MemAlloc(size_t size)
IMGUI_API void MarkIniSettingsDirty()
IMGUI_API void ItemSize(const ImVec2 &size, float text_baseline_y=-1.0f)
IMGUI_API void PopClipRect()
IMGUI_API ImGuiKeyData * GetKeyData(ImGuiKey key)
IMGUI_API bool BeginPopupContextWindow(const char *str_id=NULL, ImGuiPopupFlags popup_flags=1)
IMGUI_API void ShowDebugLogWindow(bool *p_open=NULL)
IMGUI_API bool IsKeyReleased(ImGuiKey key)
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTable *table)
IMGUI_API float GetScrollMaxX()
IMGUI_API ImGuiContext * GetCurrentContext()
IMGUI_API void DebugRenderViewportThumbnail(ImDrawList *draw_list, ImGuiViewportP *viewport, const ImRect &bb)
IMGUI_API void PopTabStop()
IMGUI_API void BulletText(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API void EndChild()
IMGUI_API void EndColumns()
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void DebugLogV(const char *fmt, va_list args) IM_FMTLIST(1)
IMGUI_API void SaveIniSettingsToDisk(const char *ini_filename)
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiCond cond=0, const ImVec2 &pivot=ImVec2(0, 0))
IMGUI_API void RenderNavHighlight(const ImRect &bb, ImGuiID id, ImGuiNavHighlightFlags flags=ImGuiNavHighlightFlags_TypeDefault)
IMGUI_API void DebugNodeWindow(ImGuiWindow *window, const char *label)
IMGUI_API void StartMouseMovingWindow(ImGuiWindow *window)
IMGUI_API void TabBarQueueReorder(ImGuiTabBar *tab_bar, ImGuiTabItem *tab, int offset)
IMGUI_API void ShowMetricsWindow(bool *p_open=NULL)
IMGUI_API void SetNextFrameWantCaptureMouse(bool want_capture_mouse)
IMGUI_API void BringWindowToFocusFront(ImGuiWindow *window)
IMGUI_API int GetMouseClickedCount(ImGuiMouseButton button)
bool TestBit(int n) const
T * alloc_chunk(size_t sz)
T * ptr_from_offset(int off)
int offset_from_ptr(const T *p)
ImDrawCallback UserCallback
ImVector< ImDrawList * > Layers[2]
IMGUI_API void FlattenIntoSingleLayer()
unsigned int _VtxCurrentIdx
IMGUI_API void _PopUnusedDrawCmd()
IMGUI_API void PopClipRect()
IMGUI_API void _ResetForNewFrame()
IMGUI_API void PushClipRect(const ImVec2 &clip_rect_min, const ImVec2 &clip_rect_max, bool intersect_with_current_clip_rect=false)
void PathStroke(ImU32 col, ImDrawFlags flags=0, float thickness=1.0f)
IMGUI_API void _ClearFreeMemory()
ImVector< ImDrawCmd > CmdBuffer
ImDrawVert * _VtxWritePtr
IMGUI_API void AddRectFilled(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawFlags flags=0)
IMGUI_API void PathArcToFast(const ImVec2 ¢er, float radius, int a_min_of_12, int a_max_of_12)
IMGUI_API void PushTextureID(ImTextureID texture_id)
void PathLineTo(const ImVec2 &pos)
IMGUI_API void AddDrawCmd()
IMGUI_API void AddLine(const ImVec2 &p1, const ImVec2 &p2, ImU32 col, float thickness=1.0f)
ImVector< ImDrawVert > VtxBuffer
IMGUI_API void AddPolyline(const ImVec2 *points, int num_points, ImU32 col, ImDrawFlags flags, float thickness)
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2 &p_min, const ImVec2 &p_max, const ImVec2 &uv_min=ImVec2(0, 0), const ImVec2 &uv_max=ImVec2(1, 1), ImU32 col=IM_COL32_WHITE)
IMGUI_API void AddText(const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL)
ImDrawListSharedData * _Data
IMGUI_API void AddRect(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawFlags flags=0, float thickness=1.0f)
IMGUI_API void PopTextureID()
ImVector< ImDrawIdx > IdxBuffer
ImVector< ImVec4 > _ClipRectStack
void PathFillConvex(ImU32 col)
IMGUI_API void AddCircleFilled(const ImVec2 ¢er, float radius, ImU32 col, int num_segments=0)
IMGUI_API void PathArcTo(const ImVec2 ¢er, float radius, float a_min, float a_max, int num_segments=0)
const ImVec4 * TexUvLines
ImVector< ImVec2 > TempBuffer
float CurveTessellationTol
ImDrawListFlags InitialFlags
ImVec4 ClipRectFullscreen
void SetCircleTessellationMaxError(float max_error)
ImVector< ImFont * > Fonts
IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2 *out_offset, ImVec2 *out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
ImVec4 TexUvLines[IM_DRAWLIST_TEX_LINES_WIDTH_MAX+1]
ImVector< ImFontGlyph > Glyphs
IMGUI_API bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)
IMGUI_API void RenderChar(ImDrawList *draw_list, float size, const ImVec2 &pos, ImU32 col, ImWchar c) const
ImFontAtlas * ContainerAtlas
IMGUI_API const ImFontGlyph * FindGlyphNoFallback(ImWchar c) const
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char *text_begin, const char *text_end=NULL, const char **remaining=NULL) const
const ImFontConfig * ConfigData
ImGuiContextHookType Type
ImGuiContextHookCallback Callback
int WantCaptureKeyboardNextFrame
int DragDropSourceFrameCount
bool FontAtlasOwnedByContext
ImGuiID NavActivateDownId
ImGuiPlatformImeData PlatformImeData
ImGuiID HoveredIdPreviousFrame
float FramerateSecPerFrame[60]
ImGuiKeyChord ConfigNavWindowingKeyPrev
ImVector< ImGuiPopupData > OpenPopupStack
ImVector< ImGuiWindow * > Windows
ImGuiNextWindowData NextWindowData
bool DebugItemPickerActive
bool HoveredIdAllowOverlap
ImChunkStream< ImGuiWindowSettings > SettingsWindows
ImVector< ImGuiWindow * > WindowsFocusOrder
ImVector< ImGuiWindow * > WindowsTempSortBuffer
ImVec2 WindowsHoverPadding
ImGuiID NavActivatePressedId
ImGuiWindow * MovingWindow
ImGuiKeyChord ConfigNavWindowingKeyNext
ImVec2 ActiveIdClickOffset
ImU8 DebugItemPickerMouseButton
ImGuiItemFlags CurrentItemFlags
bool ActiveIdUsingAllKeyboardKeys
ImGuiTextBuffer DebugLogBuf
const char * LocalizationTable[ImGuiLocKey_COUNT]
ImVector< ImGuiID > MenusIdSubmittedThisFrame
ImGuiInputSource NavInputSource
ImGuiWindow * WheelingWindow
ImGuiInputSource ActiveIdSource
ImGuiMetricsConfig DebugMetricsConfig
bool NavWindowingToggleLayer
ImGuiPayload DragDropPayload
float WheelingWindowReleaseTimer
ImGuiNextItemData NextItemData
float DisabledAlphaBackup
ImGuiDebugLogFlags DebugLogFlags
ImGuiLastItemData LastItemData
bool ActiveIdPreviousFrameHasBeenEditedBefore
int LogDepthToExpandDefault
const char * LogNextPrefix
ImGuiActivateFlags NavNextActivateFlags
float DragDropAcceptIdCurrRectSurface
ImGuiStackTool DebugStackTool
ImRect NavInitResultRectRel
ImVector< ImGuiPopupData > BeginPopupStack
ImVector< ImGuiPtrOrIndex > CurrentTabBarStack
ImGuiScrollFlags NavMoveScrollFlags
ImVector< ImGuiID > FocusScopeStack
ImGuiTextIndex DebugLogIndex
float NavWindowingHighlightAlpha
ImGuiNavItemData NavMoveResultLocal
ImGuiTextBuffer SettingsIniData
bool DragDropWithinSource
ImGuiDragDropFlags DragDropSourceFlags
ImVector< ImGuiTableTempData > TablesTempData
int FramerateSecPerFrameIdx
int FramerateSecPerFrameCount
ImVector< ImGuiContextHook > Hooks
ImGuiNavItemData NavMoveResultOther
ImGuiID CurrentFocusScopeId
ImU32 ActiveIdUsingNavDirMask
ImGuiWindow * HoveredWindow
ImVec2 NavWindowingAccumDeltaPos
ImDrawListSharedData DrawListSharedData
ImVec2 WheelingWindowWheelRemainder
ImGuiDragDropFlags DragDropAcceptFlags
ImGuiID HoverDelayIdPreviousFrame
ImVector< ImGuiGroupData > GroupStack
int WantCaptureMouseNextFrame
ImGuiNavItemData NavTabbingResultFirst
ImGuiTextBuffer LogBuffer
int DragDropAcceptFrameCount
ImVector< ImGuiShrinkWidthItem > ShrinkWidthBuffer
ImGuiID DragDropHoldJustPressedId
ImVector< ImGuiItemFlags > ItemFlagsStack
const char * LogNextSuffix
int ClipperTempDataStacked
ImGuiID DebugItemPickerBreakId
ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT]
ImVector< ImFont * > FontStack
ImPool< ImGuiTabBar > TabBars
ImGuiWindow * NavWindowingTarget
bool NavInitRequestFromMove
ImGuiDir NavMoveDirForDebug
ImGuiWindow * ActiveIdWindow
ImVector< ImGuiWindowStackData > CurrentWindowStack
ImRect DragDropTargetRect
ImGuiKeyRoutingTable KeysRoutingTable
bool ActiveIdHasBeenPressedBefore
bool ActiveIdIsJustActivated
ImVector< ImGuiViewportP * > Viewports
ImGuiWindow * CurrentWindow
ImVector< ImGuiListClipperData > ClipperTempData
ImVector< float > TablesLastTimeActive
ImGuiWindow * NavWindowingListWindow
bool ActiveIdPreviousFrameIsAlive
ImGuiWindow * NavWindowingTargetAnim
bool WithinFrameScopeWithImplicitWindow
ImVector< char > ClipboardHandlerData
ImVector< char > TempBuffer
bool ActiveIdAllowOverlap
ImGuiMouseCursor MouseCursor
ImGuiInputTextState InputTextState
ImGuiID DragDropAcceptIdPrev
ImVec2 NavWindowingAccumDeltaSize
bool DragDropWithinTarget
ImVector< ImGuiStyleMod > StyleVarStack
ImGuiID NavNextActivateId
float FramerateSecPerFrameAccum
ImVector< ImDrawChannel > DrawChannelsTempMergeBuffer
int WantTextInputNextFrame
ImGuiWindow * ActiveIdPreviousFrameWindow
unsigned char DragDropPayloadBufLocal[16]
float HoveredIdNotActiveTimer
ImU32 ActiveIdUsingNavInputMask
ImGuiWindow * HoveredWindowUnderMovingWindow
bool ActiveIdHasBeenEditedBefore
bool NavMoveForwardToNextFrame
ImGuiPlatformImeData PlatformImeDataPrev
ImChunkStream< ImGuiTableSettings > SettingsTables
int WheelingWindowStartFrame
float HoverDelayClearTimer
ImGuiKeyChord NavMoveKeyMods
ImGuiTable * CurrentTable
ImGuiKeyChord NavJustMovedToKeyMods
ImVector< ImGuiSettingsHandler > SettingsHandlers
ImRect NavScoringNoClipRect
ImGuiTabBar * CurrentTabBar
ImGuiActivateFlags NavActivateFlags
ImVector< ImGuiColorMod > ColorStack
ImGuiNavItemData NavMoveResultLocalVisible
ImGuiNavMoveFlags NavMoveFlags
ImVector< ImGuiInputEvent > InputEventsQueue
short TooltipOverrideCount
bool ActiveIdHasBeenEditedThisFrame
ImVec2 WheelingWindowRefMousePos
ImVector< ImGuiInputEvent > InputEventsTrail
bool ActiveIdNoClearOnFocusLoss
ImGuiID NavJustMovedToFocusScopeId
bool NavDisableMouseHover
ImGuiID DragDropAcceptIdCurr
ImVector< unsigned char > DragDropPayloadBufHeap
ImGuiID ActiveIdPreviousFrame
ImPool< ImGuiTable > Tables
ImU8 DebugLogClipperAutoDisableFrames
void * GetVarPtr(void *parent) const
float BackupCurrLineTextBaseOffset
bool BackupHoveredIdIsAlive
ImGuiID BackupActiveIdIsAlive
ImVec2 BackupCursorMaxPos
ImVec2 BackupCurrLineSize
bool BackupActiveIdPreviousFrameIsAlive
void(* SetPlatformImeDataFn)(ImGuiViewport *viewport, ImGuiPlatformImeData *data)
IMGUI_API void AddFocusEvent(bool focused)
bool WantCaptureMouseUnlessPopupClose
IMGUI_API void AddInputCharacterUTF16(ImWchar16 c)
IMGUI_API void AddInputCharacter(unsigned int c)
float MouseDoubleClickMaxDist
bool ConfigWindowsMoveFromTitleBarOnly
void(* SetClipboardTextFn)(void *user_data, const char *text)
int MetricsActiveAllocations
ImVec2 MouseClickedPos[5]
IMGUI_API void AddMouseWheelEvent(float wheel_x, float wheel_y)
ImWchar16 InputQueueSurrogate
ImVector< ImWchar > InputQueueCharacters
IMGUI_API void AddKeyEvent(ImGuiKey key, bool down)
const char * BackendPlatformName
float MouseDownDurationPrev[5]
bool KeysDown[ImGuiKey_COUNT]
IMGUI_API void ClearInputKeys()
bool MouseDownOwnedUnlessPopupClose[5]
ImGuiConfigFlags ConfigFlags
IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index=-1)
void * BackendPlatformUserData
ImGuiKeyData KeysData[ImGuiKey_KeysData_SIZE]
ImVec2 DisplayFramebufferScale
ImS8 BackendUsingLegacyKeyArrays
IMGUI_API void ClearInputCharacters()
float MouseDragMaxDistanceSqr[5]
bool MouseDoubleClicked[5]
IMGUI_API void SetAppAcceptingEvents(bool accepting_events)
int MetricsRenderVertices
bool ConfigDragClickToInputText
ImGuiBackendFlags BackendFlags
const char *(* GetClipboardTextFn)(void *user_data)
void * BackendRendererUserData
IMGUI_API void AddMouseButtonEvent(int button, bool down)
int KeyMap[ImGuiKey_COUNT]
bool BackendUsingLegacyNavInputArray
bool ConfigWindowsResizeFromEdges
bool ConfigMacOSXBehaviors
float MouseDownDuration[5]
IMGUI_API void AddMousePosEvent(float x, float y)
bool ConfigInputTextEnterKeepActive
IMGUI_API void AddInputCharactersUTF8(const char *str)
ImU16 MouseClickedCount[5]
IMGUI_API void AddKeyAnalogEvent(ImGuiKey key, bool down, float v)
const char * BackendRendererName
bool ConfigInputTextCursorBlink
void * BackendLanguageUserData
float ConfigMemoryCompactTimer
float MouseDoubleClickTime
ImU16 MouseClickedLastCount[5]
bool ConfigInputTrickleEventQueue
bool FontAllowUserScaling
double MouseClickedTime[5]
ImGuiKeyRoutingIndex NextEntryIndex
ImVector< ImGuiKeyRoutingData > Entries
ImVector< ImGuiKeyRoutingData > EntriesNext
ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT]
ImGuiItemStatusFlags StatusFlags
void Reset(ImGuiListClipper *clipper)
ImVector< ImGuiListClipperRange > Ranges
IMGUI_API void ForceDisplayRangeByIndices(int item_min, int item_max)
IMGUI_API void Begin(int items_count, float items_height=-1.0f)
IMGUI_API ~ImGuiListClipper()
IMGUI_API ImGuiListClipper()
static ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max)
static ImGuiListClipperRange FromIndices(int min, int max)
void Update(float spacing, bool window_reappearing)
bool ShowDrawCmdBoundingBoxes
bool ShowAtlasTintedWithTextColor
bool ShowWindowsBeginOrder
ImGuiNextItemDataFlags Flags
void * SizeCallbackUserData
ImRect SizeConstraintRect
ImGuiNextWindowDataFlags Flags
ImVec2 MenuBarOffsetMinVal
ImGuiSizeCallback SizeCallback
ImGuiOldColumnFlags Flags
ImVector< ImGuiOldColumnData > Columns
bool IsDataType(const char *type) const
void(* ReadLineFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, void *entry, const char *line)
void(* ClearAllFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler)
void *(* ReadOpenFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, const char *name)
void(* ApplyAllFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler)
void(* WriteAllFn)(ImGuiContext *ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *out_buf)
short SizeOfStyleVarStack
short SizeOfBeginPopupStack
void SetToContextState(ImGuiContext *ctx)
void CompareWithContextState(ImGuiContext *ctx)
short SizeOfDisabledStack
short SizeOfFocusScopeStack
short SizeOfItemFlagsStack
IMGUI_API float GetFloat(ImGuiID key, float default_val=0.0f) const
IMGUI_API bool GetBool(ImGuiID key, bool default_val=false) const
IMGUI_API int * GetIntRef(ImGuiID key, int default_val=0)
IMGUI_API void ** GetVoidPtrRef(ImGuiID key, void *default_val=NULL)
IMGUI_API float * GetFloatRef(ImGuiID key, float default_val=0.0f)
IMGUI_API void SetVoidPtr(ImGuiID key, void *val)
IMGUI_API void BuildSortByKey()
ImVector< ImGuiStoragePair > Data
IMGUI_API void * GetVoidPtr(ImGuiID key) const
IMGUI_API void SetFloat(ImGuiID key, float val)
IMGUI_API void SetBool(ImGuiID key, bool val)
IMGUI_API int GetInt(ImGuiID key, int default_val=0) const
IMGUI_API void SetAllInt(int val)
IMGUI_API bool * GetBoolRef(ImGuiID key, bool default_val=false)
IMGUI_API void SetInt(ImGuiID key, int val)
ImVec4 Colors[ImGuiCol_COUNT]
float CurveTessellationTol
ImGuiDir ColorButtonPosition
IMGUI_API void ScaleAllSizes(float scale_factor)
float SeparatorTextBorderSize
ImVec2 DisplaySafeAreaPadding
ImVec2 DisplayWindowPadding
ImVec2 SeparatorTextAlign
ImGuiDir WindowMenuButtonPosition
float CircleTessellationMaxError
bool AntiAliasedLinesUseTex
float TabMinWidthForCloseButton
ImVec2 SeparatorTextPadding
ImVec2 SelectableTextAlign
ImVector< ImGuiTabItem > Tabs
float ContentMaxXHeadersIdeal
float ContentMaxXHeadersUsed
float ContentMaxXUnfrozen
ImGuiTableColumnIdx HoveredColumnBody
ImSpan< ImGuiTableColumn > Columns
ImGuiWindow * OuterWindow
ImGuiWindow * InnerWindow
IMGUI_API void appendf(const char *fmt,...) IM_FMTARGS(2)
void reserve(int capacity)
static IMGUI_API char EmptyString[1]
IMGUI_API void append(const char *str, const char *str_end=NULL)
const char * c_str() const
IMGUI_API void appendfv(const char *fmt, va_list args) IM_FMTLIST(2)
const char * begin() const
IMGUI_API void split(char separator, ImVector< ImGuiTextRange > *out) const
IMGUI_API ImGuiTextFilter(const char *default_filter="")
ImVector< ImGuiTextRange > Filters
IMGUI_API bool PassFilter(const char *text, const char *text_end=NULL) const
IMGUI_API bool Draw(const char *label="Filter (inc,-exc)", float width=0.0f)
const char * get_line_end(const char *base, int n)
void append(const char *base, int old_size, int new_size)
const char * get_line_begin(const char *base, int n)
ImDrawDataBuilder DrawDataBuilder
ImVec2 BuildWorkOffsetMax
ImDrawList * DrawLists[2]
ImRect GetMainRect() const
ImRect GetWorkRect() const
ImVec2 BuildWorkOffsetMin
int DrawListsLastFrame[2]
ImRect TitleBarRect() const
ImGuiCond SetWindowSizeAllowFlags
int MemoryDrawListVtxCapacity
short BeginCountPreviousFrame
ImVector< ImGuiID > IDStack
ImGuiID NavLastIds[ImGuiNavLayer_COUNT]
ImGuiStorage StateStorage
signed char ResizeBorderHeld
ImVec2 ScrollTargetCenterRatio
ImGuiID GetIDFromRectangle(const ImRect &r_abs)
ImGuiCond SetWindowCollapsedAllowFlags
ImRect MenuBarRect() const
ImGuiWindow * RootWindowPopupTree
ImGuiID NavRootFocusScopeId
ImGuiWindow * ParentWindow
ImS8 HiddenFramesForRenderOnly
ImVec2ih HitTestHoleOffset
ImGuiID GetID(const char *str, const char *str_end=NULL)
float CalcFontSize() const
ImGuiWindow * NavLastChildNavWindow
ImS8 HiddenFramesCannotSkipItems
ImGuiCond SetWindowPosAllowFlags
ImGuiWindow * RootWindowForNav
int MemoryDrawListIdxCapacity
ImGuiWindow * ParentWindowInBeginStack
ImVec2 ScrollTargetEdgeSnapDist
short BeginOrderWithinParent
ImGuiDir AutoPosLastDirection
ImVec2 ContentSizeExplicit
ImRect NavRectRel[ImGuiNavLayer_COUNT]
ImGuiViewportP * Viewport
ImGuiWindow(ImGuiContext *context, const char *name)
float MenuBarHeight() const
float TitleBarHeight() const
ImVector< ImGuiOldColumns > ColumnsStorage
ImGuiWindow * RootWindowForTitleBarHighlight
ImS8 HiddenFramesCanSkipItems
short BeginOrderWithinContext
ImGuiLastItemData ParentLastItemDataBackup
ImGuiStackSizes StackSizesOnBegin
bool NavHideHighlightOneFrame
ImU32 TreeJumpToParentOnPopMask
float CurrLineTextBaseOffset
ImVec2 CursorStartPosLossyness
short NavLayersActiveMask
ImGuiLayoutType LayoutType
float PrevLineTextBaseOffset
short NavLayersActiveMaskNext
ImGuiMenuColumns MenuColumns
ImGuiNavLayer NavLayerCurrent
ImVector< float > TextWrapPosStack
ImVector< float > ItemWidthStack
ImVector< ImGuiWindow * > ChildWindows
ImGuiOldColumns * CurrentColumns
ImGuiStorage * StateStorage
ImGuiLayoutType ParentLayoutType
T * GetByIndex(ImPoolIdx n)
int GetAliveCount() const
T * TryGetMapData(ImPoolIdx n)
bool Overlaps(const ImRect &r) const
void TranslateX(float dx)
void ClipWithFull(const ImRect &r)
void Add(const ImVec2 &p)
void Translate(const ImVec2 &d)
void TranslateY(float dy)
void ClipWith(const ImRect &r)
bool Contains(const ImVec2 &p) const
void Expand(const float amount)
void reserve(int new_capacity)
void push_front(const T &v)
bool contains(const T &v) const
int index_from_ptr(const T *it) const
void push_back(const T &v)
void resize(int new_size)
void swap(ImVector< T > &rhs)